Say I got one EditText and one Button next to each other horizontally. Left we got the EditText and right the Button.
The thing is, I want the button to wrap it’s content while the EditText stretches itself from the left of the screen all the way to the button. So the button is as small as possible (depending on button text) and the EditText is as wide as possible (depending on button size)
I don’t know if I’ve missed a simple trick… but how do I accomplish that?
You have to use a RelativeLayout, make the Button align right and set the EditText to be left of the button. After that, fill_parent for the EditText and wrap_content for the Button will do the magic.
A look at the code below clarifies everything.