I need to create a simple layout with two form widgets (for example - two buttons). The first one must fill all available width of the parent layout and the second one must have some fixed size.
That's what I need:
If I set FILL_PARENT to the first widget - I don't see the second one. It just blows away from a view area of the layout :) I don't know how to fix this...
You can accomplish that with a RelativeLayout or a FrameLayout.
The easiest way to do this is using
layout_weight
withLinearLayout
. Notice the width of the first TextView is"0dp"
, which means "ignore me and use the weight". The weight can be any number; since it's the only weighted view, it will expand to fill available space.