I have a chat layout that's somewhat similar to Facebook's and Yahoo! Messenger's, i.e. a Fragment
header, a ListView
of messages, and a RelativeLayout
footer, which has an EditText
and a bunch of Buttons
.
[ HEADER ]
______________________________
| |
| |
| |
| |
| Messages |
| |
| |
| |
| |
|______________________________|
[BTN][ EditText [IMG]][BTN]
When I type in long text, I want this:
[ HEADER ]
______________________________
| |
| Messages |
|______________________________|
____________________
| EditText |
| |
| |
| |
[BTN][ [IMG]][BTN]
but instead, I get this:
[ HEADER ]
______________________________
| |
| Messages |
|______________________________|
____________________
[BTN]| EditText [IMG]|[BTN]
| |
| |
| |
[ ]
I tried setting the layout's gravity="BOTTOM"
, but that didn't work. I tried using layout_alignParentBottom="true"
, but that made the footer take up the entire screen.
Any suggestions?
Fixed by using a
LinearLayout
,android:gravity="bottom"
, and wrapping theEditText
and some other stuff into aRelativeLayout
.