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

  • Home
  • SEARCH
  • 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 4125982
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:56:27+00:00 2026-05-20T23:56:27+00:00

I have two LinearLayout s in my Android application. One (the top) holds a

  • 0

I have two LinearLayouts in my Android application. One (the top) holds a TextView and a Button and the one below it holds two buttons. I was wondering if there was a way to make the right button of the upper LinearLayout the same size as the right button of the bottom LinearLayout.

<LinearLayout android:layout_width="fill_parent"
     android:id="@+id/linearLayout1" android:layout_height="wrap_content"
     android:orientation="horizontal" android:paddingTop="15.0dip">

     <TextView 
          android:paddingLeft="5.0dip" 
          android:textSize="33px"
          android:textStyle="bold" 
          android:layout_height="wrap_content"
          android:id="@+id/textViewPoints" 
          android:text="Points: 0"
          android:layout_width="wrap_content" 
          android:layout_gravity="center_vertical"
          android:paddingRight="25.0dip" 
          android:layout_weight="0" />

     <Button 
          android:enabled="false" 
          android:onClick="myClickHandler"
          android:layout_height="wrap_content" 
          android:id="@+id/buttonAddTracker"
          android:layout_width="fill_parent"  
          android:layout_gravity="center_vertical"
          android:text="@string/buttonAddTracker" 
          android:layout_weight="1" />
</LinearLayout>

<LinearLayout 
     android:orientation="horizontal"
     android:id="@+id/linearLayout2" android:layout_width="fill_parent"
     android:layout_height="wrap_content" android:paddingTop="15.0dip">

     <Button 
          android:text="Calculate" 
          android:id="@+id/button01"
          android:layout_width="fill_parent" 
          android:layout_height="wrap_content"
          android:layout_weight="1" 
          android:onClick="myClickHandler" />

     <Button 
          android:text="Reset" 
          android:id="@+id/button02"
          android:layout_toRightOf="@+id/button01" 
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" 
          android:layout_weight="1"
          android:onClick="myClickHandler"></Button>
</LinearLayout>
  • 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-20T23:56:28+00:00Added an answer on May 20, 2026 at 11:56 pm

    Well there are two ways how you can do that …

    1) If you are using Linear Layout as you are, then you’ll have to fix the WIDTH of the Left TextView and Left Button then can’t be wrap content , just give them say 40 dip . After that put Right Buttons Width to fill_parent or fix a WIDTH for them too .

    2) Use TableLayout and put each of them in their respective columns and rows and the TableLayout should handle it for you.

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

Sidebar

Related Questions

Ok, i have two buttons in linear layout: <LinearLayout android:id=@+id/linearLayout1 android:layout_height=wrap_content android:layout_width=fill_parent> <Button android:id=@+id/aktiviraj_paket
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
In my application screen, i have two buttons. one is Activate and another is
I have a LinearLayout in my android application. Worked well with just the two
In My application XML layout, I have one Relativelayout, In which there are two
Intro: I have a LinearLayout, which contains two sub LinearLayouts, like so: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have an Android Honeycomb application with two activities; the first one has a
I want to have two buttons top of a listview. If I scroll below
I have two ImageButtons, and I am trying to stack one on top of
I'm writing my first Android application and I have one activity that I'd like

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.