I want to put a button next to a EditText and I want their heights to match.
For example, from the built in Android browser:
The Go button is the same height as the EditText field. I know I could wrap both these views in a parent layout view, and set both of their heights to fill_parent, and that would make them match. However, I would like to do this without having to give the layout a static size. I would rather have the EditText take whatever height it needs based on the font size and then have the button next to it match whatever height that might be.
Is this possible with an xml layout?
Presumably the EditText
and the Button
are inside a RelativeLayout
. Set the button's layout attributes to alignTop
and alignBottom
of the EditText
.