android:layout_alignParentBottom is ignored when used without explicit layout height as a row in ListView

前端 未结 4 1488
灰色年华
灰色年华 2021-02-13 15:40

When I use a RelativeLayout with either fill_parent or wrap_content as height and an element which specifies: android:layout_alignPa

4条回答
  •  有刺的猬
    2021-02-13 16:34

    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.

提交回复
热议问题