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 6789417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:36:06+00:00 2026-05-26T17:36:06+00:00

In my application screen, i have two buttons. one is Activate and another is

  • 0

In my application screen, i have two buttons. one is Activate and another is About. I want Activate in left side and About in right side and both will be same size. I write the below code:

    <LinearLayout
    android:id="@+id/layout2"
    android:layout_width="fill_parent"
    android:layout_height="60px"
    android:layout_alignParentBottom="true"
    android:background="@drawable/bottom_bar"
>
<Button
    android:id="@+id/btnActivate"
    android:layout_width="0dp"
    android:layout_height="40px"
    android:layout_marginTop="10px"
    android:layout_weight="1.0"
    android:text="Activate"
    android:textColor="#000000"
>
</Button>
<Button
    android:id="@+id/btnAbout"
    android:layout_weight="1.0"
    android:layout_width="0dp"
    android:layout_height="40px"
    android:layout_marginTop="10px"
    android:text="About"
    android:textColor="#000000"
>
</Button>
</LinearLayout>

Now both the button is coming with same size. But i want them with some specific width like 60 dp. How can i do that??

Thanks in advance.

  • 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-26T17:36:07+00:00Added an answer on May 26, 2026 at 5:36 pm

    By setting android:layout_weight to 1 for both buttons, you ask the buttons to expand and cover the whole width of the layout with equal width (weight).

    Remove the android:layout_weight attribute and set android:layout_width to the desired width.

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

Sidebar

Related Questions

In my application i have two screen. Screen1 and screen2 . If i am
I'm writing an application which have two modes; one view mode and one edit
I am creating an touch screen application using Swing and have a request to
OK, this is a slightly weird question. We have a touch-screen application (i.e., no
I have a Silverlight application running full screen. Is there a way i can
I have a screen where you can enable/disable modules for my Android application. For
I'm working on an application, and I have a screen that in my mind,
We have a WinForms application which runs on a touch-screen on a bit of
I'd like my application to have a full-screen mode. What is the easiest way
I have a mature MFC C++ application that displays on screen and prints using

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.