When I use a RelativeLayout
with either fill_parent
or wrap_content
as height and an element which specifies: android:layout_alignParentBottom="true"
it is ignored and it is aligned at the top. Setting the height of the RelativeLayout
to an explicit value makes it work. Any clues?
This seems to be a bug in Android itself, see http://code.google.com/p/android/issues/detail?id=1394.
I worked around it by wrapping my RelativeLayout
in a FrameLayout
and putting my bottom aligned view as a children of the FrameLayout
with android:layout_gravity="bottom"
. This hinders you from referencing it from within the RelativeLayout
so you'll have to work around that (for example using margins).
If anyone has a better workaround, please share.
When you inflate the layout, use inflate(R.layout.whatever, parent, false)
, where parent
is the ListView
. If you don't do that (e.g., you pass null
for the parent), RelativeLayout
gets strange in list rows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With