Since no one explains why their solutions work, I will give it back.
The problem is the location of the buttons. The two relevant attributes are layout_width and layout_weight.
In other layout systems, when you specify that each layout element should fill in the parent element (layout_width = "fill_parent"), they do this by distributing equal parent space between them. Thus, each of them will have the same size.
Instead, in the Android layout system, if both elements have layout_width = "fill_parent" the first element (in your case, the Preview button) will be stretched to fill the parent element, and the second (or third, etc.) will not leave room for spread, therefore, will not be visible.
Now, in order to understand that you want to show both buttons, you set layout_weight for each button. For the buttons to have the same size, set the same layout weight for both of them.
The layout_definition determines how many βpartsβ (or segments) of the parent each button occupies. The parent will be split into several segments equal to the sum of the child segments. If you want to make one button three times larger than the other, you must assign it the number of parts equal to the number of parts of the first button multiplied by three.
So, if you want your Next button to be twice as large as Previews, you can do this:
- for the Previews button: layout_weight = 1
- for the Next button: layout_weight = 2
As a result, the parent will be cut into 3 parts, 2 of which will be highlighted to the Next button and 1 to the Previews button.
The example given here is for buttons and horizontal layout, but this will work great for any type of object, as well as for the parent of the vertical layout.