How can I set a fixed width for an Android button? Everytime I try to set a fixed width it fills the current parent (the RelativeView). Here is my XML:
To accomplish what you want, you can use a LinearLayout with a weightsum. For example, you can put a WeightSum of 9. If you put the weight of three button inside to 1 each. They will take 1/3 of the place, and you can put 2 for another object. This object will be twice as big as the other.
http://developer.android.com/reference/android/widget/LinearLayout.html#setWeightSum(float)
Edit: I would like to add that for this to work correctly, you have to set the width or height to 0px (depending on if it's an horizontal or a vertical layout).