This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Android and the fly likes Button Sizes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Button Sizes" Watch "Button Sizes" New topic

Button Sizes

Muhammad Imad Qureshi
Ranch Hand

Joined: Sep 13, 2005
Posts: 238
I have asked a similar question before so I apologize for asking this one but I am stuck. If you see the following layout file, you'll see that I have three buttons in each row. The text on each button is either 3 or 4 characters. I want all buttons to be same size. But the button in first column in each row is greater than the other two. How can I do this. I just changed it to dip and still dont work. I had "wrap_content" for width before.


Monu Tripathi

Joined: Oct 12, 2008
Posts: 1369

You should be able to work this out using android:weight attribute.
I don't have time to look at your code; see these threads:
1. Two equal width buttons and
2. Fixed width button

[List of FAQs] | [Android FAQ] | [Samuh Varta]
I agree. Here's the link:
subject: Button Sizes
It's not a secret anymore!