> On Mon, Jan 10, 2011 at 7:01 PM, John Lussmyer <[email protected]>wrote: > > > Is there any way to do that via settings in the XML? > Give them both the same weight.
Sadly, this also works only for short texts like OK and Cancel. If you need word wrap or a word's too long, the layout is messed up. Sometimes I even had different widths for ImageButtons which showed images exactly the same size. The only sometimes working workaround seems to be to use "fill_parent" as width for both/all buttons. But it only works as long as all buttons in the LinearLayout share the same weight and there's no fixed width element, and I guess even that is more like a bug that became a feature than actually intented. There doesn't seem to be any simple, reliable, always working way to get buttons use exactly the given percentage of the available space. (I guess another workaround would be to get the width of the screen or parent view and set the button widths programmatically...) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

