Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6097087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:08+00:00 2026-05-23T13:00:08+00:00

i have a Relative layout which has some buttons and imagebuttons with tabbar in

  • 0

i have a Relative layout which has some buttons and imagebuttons with tabbar in bottom.

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical" >

   <TextView android:id="@+id/statustext" android:layout_width="wrap_content" android:textColor = "@color/white" android:layout_height="wrap_content" 
        android:text="Welcome to www.****.com" android:layout_weight = "1" />

   <EditText android:id="@+id/welcome" android:hint="Please enter your name" android:layout_width="fill_parent" android:scaleType="center" android:singleLine="true" 
          android:layout_below = @+id/statustext"  android:cursorVisible = "false" android:layout_height="wrap_content" android:layout_weight = "1" >
   </EditText>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height= "wrap_content"
                android:orientation="vertical" android:layout_below = "@+id/welcome">
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button1" android:text="new user" android:layout_below="@+id/welcome"        android:layout_width="103dp" android:layout_alignLeft="@+id/welcome"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button4" android:text="Registered?" android:layout_below="@+id/button1" android:layout_width="103dp" android:layout_alignLeft="@+id/button1" android:layout_alignRight="@+id/button1"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button7" android:text="Forgot Pass" android:layout_below="@+id/button4" android:layout_width="103dp" android:layout_alignLeft="@+id/button4" android:layout_alignRight="@+id/button4"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button10" android:text="Email" android:layout_below="@+id/button7" android:layout_width="103dp" android:layout_alignLeft="@+id/button7" android:layout_alignRight="@+id/button7"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button2" android:text="Sign-In" android:layout_width="103dp" android:layout_toRightOf="@+id/button1" android:layout_alignTop="@+id/button1" android:layout_alignBottom="@+id/button1"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button5" android:text="Username" android:layout_below="@+id/button2" android:layout_width="103dp" android:layout_alignLeft="@+id/button2" android:layout_alignRight="@+id/button2"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button8" android:text="Password" android:layout_below="@+id/button5" android:layout_width="103dp" android:layout_alignLeft="@+id/button5" android:layout_alignRight="@+id/button5"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button11" android:text="Cart" android:layout_below="@+id/button8" android:layout_width="103dp" android:layout_alignLeft="@+id/button8" android:layout_alignRight="@+id/button8"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button3" android:text="Search" android:layout_width="103dp" android:layout_toRightOf="@+id/button2" android:layout_alignTop="@+id/button2" android:layout_alignBottom="@+id/button2"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button6" android:text="Call *****" android:layout_below="@+id/button3" android:layout_width="103dp" android:layout_alignLeft="@+id/button3" android:layout_alignRight="@+id/button3"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button9" android:text="Register" android:layout_below="@+id/button6" android:layout_width="103dp" android:layout_alignLeft="@+id/button6" android:layout_alignRight="@+id/button6"></Button>
<Button android:layout_height="wrap_content" android:layout_weight = "1"   android:id="@+id/button12" android:text="Follow Us" android:layout_below="@+id/button9" android:layout_width="103dp" android:layout_alignLeft="@+id/button9" android:layout_alignRight="@+id/button9"></Button>
<Button android:id="@+id/bluebutton" android:layout_below = "@id/button10" android:layout_weight = "1" android:layout_height="wrap_content" android:layout_width="103dp" android:layout_alignParentLeft = "true"  android:background="@drawable/blue_logo"></Button>
<Button android:id="@+id/bluebutton" android:layout_below = "@id/button11" android:layout_weight = "1" android:layout_height="wrap_content" android:layout_width="103dp"   android:layout_toRightOf = "@+id/dialer" android:background="@drawable/orange_logo"></Button>
<Button android:id="@+id/blackbutton"  android:layout_below = "@id/button12" android:layout_weight = "1"  android:layout_height="wrap_content" android:layout_width="103dp" android:layout_toRightOf="@+id/orangebutton"  android:background="@drawable/black_logo" ></Button>
 </RelativeLayout>

</RelativeLayout>

My problem is that i looks fine in Google Nexus(H-533 ,W-320) calculated by

   Display display = getWindowManager().getDefaultDisplay();
    int screenHeight = display.getHeight();
    int screenWidth = display.getWidth();
    Log.i("Screen Height = ",Integer.toString(screenHeight) );
    Log.i("Screen Width = ",Integer.toString(screenWidth) );

and i have created different folders according to resolution,its taking xml from

layout-normal-mdpi

when i see this layout in HTC legend(H – 480 W-320) Or Samsung Ace the last three image buttons looking compressed about half of their height between normal button and Tabbar.The problem i guess in the small height with respect to Nexus, and all three devices are using same mdpi resolution xml file .So what should i do to make this layout work according to diff screen heights of same mdpi resolution devices.

If thats not possible from layout

weight

can i change button size programmatically after calculating screen size?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:00:09+00:00Added an answer on May 23, 2026 at 1:00 pm

    Hey check this revised version and if problem persist comment me

    enter code here`<?xml version="1.0" encoding="UTF-8"?>
    

    <TextView android:id="@+id/statustext" android:layout_width="wrap_content"
        android:textColor="@color/white" android:layout_height="wrap_content"
        android:text="Welcome to www.****.com" android:layout_weight="1" />
    
    <EditText android:id="@+id/welcome" android:hint="Please enter your name"
        android:layout_width="fill_parent" android:scaleType="center"
        android:singleLine="true" android:layout_below="@+id/statustext"
        android:cursorVisible="false" android:layout_height="wrap_content"
        android:layout_weight="1">
    </EditText>
    
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:orientation="vertical" android:layout_below="@+id/welcome">
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:id="@+id/linlayout1">
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button1" android:text="new user"
                 android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button2" android:text="Sign-In"
                android:layout_width="fill_parent" 
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button3" android:text="Search"
                android:layout_width="fill_parent" 
                ></Button>
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_below="@+id/linlayout1" android:layout_height="wrap_content"
            android:id="@+id/linlayout2">
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button4" android:text="Registered?"
                android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button5" android:text="Username"
                 android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button6" android:text="Call *****"
                android:layout_width="fill_parent"
                ></Button>
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_below="@+id/linlayout2" android:layout_height="wrap_content"
            android:id="@+id/linlayout3">
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button7" android:text="Forgot Pass"
                 android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button8" android:text="Password"
                 android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button9" android:text="Register"
                android:layout_width="fill_parent"
                ></Button>
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_below="@+id/linlayout3" android:layout_height="wrap_content"
            android:id="@+id/linlayout4">
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button10" android:text="Email"
                android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button11" android:text="Cart"
                 android:layout_width="fill_parent"
                ></Button>
            <Button android:layout_height="wrap_content"
                android:layout_weight="1" android:id="@+id/button12" android:text="Follow Us"
                 android:layout_width="fill_parent"
                ></Button>
        </LinearLayout>
    
    <LinearLayout android:layout_width="fill_parent"
            android:layout_below="@+id/linlayout4" android:layout_height="wrap_content"
            android:id="@+id/linlayout5">
            <Button android:id="@+id/bluebutton" android:layout_below="@id/button10"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:layout_width="fill_parent" 
            android:background="@drawable/blue_logo"></Button>
        <Button android:id="@+id/bluebutton" android:layout_below="@id/button11"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:layout_width="fill_parent" 
            android:background="@drawable/orange_logo"></Button>
        <Button android:id="@+id/blackbutton" android:layout_below="@id/button12"
            android:layout_weight="1" android:layout_height="wrap_content"
            android:layout_width="fill_parent" 
            android:background="@drawable/black_logo"></Button>
            </LinearLayout>
    
    </RelativeLayout>
    

    `

    and yes please dont forget to write in your manifest file under application tag ending

    </application>
    <supports-screens android:smallScreens="true"
        android:normalScreens="true" android:largeScreens="true"
        android:anyDensity="true">
    </supports-screens>
    

    ‘

    this will do your full work

    thanks and enjoy happy coding

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have designed the screen using this relative layout. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
I have a Relative Layout. Which has 2 buttons, side by side and it
I have created following layout.which has two relative layouts and one scrollview ,following code
I have a relative layout defined in a xml file(say realtive.xml). In another layout
I have problems getting some of my views aligned in a relative layout that
I am writing a custom component (derived from a relative layout) which has to
I have the following Relative layout. The view at the bottom is simply a
Context: I have a TableLayout (created using XML), which has one TableRow, which has
I have a layout which has and ImageView to the left, and TextView to
I have imageView inside a relative layout. And when i create the activity i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.