Android RelativeLayout : how to alignParentBottom when wrapped in a ScrollView?

后端 未结 5 841
情话喂你
情话喂你 2020-12-05 13:31

The problem I am having seems to be that if I have a view (e.g. myButton) inside a RelativeLayout set to alignParentBottom - (as per the code below) - and then wrap the Rela

5条回答
  •  北海茫月
    2020-12-05 13:46

    Using fill_parent as the height of a child of a ScrollView is meaningless. You are telling the RelativeLayout to be always as tall as its parent. In this case, the ScrollView becomes useless! The height of the RelativeLayout should be set to wrap_content, in which case, depending on what the RelativeLayout contains, alignParentBottom may not work as you expect. You should simply use a LinearLayout, it will be much much simpler.

提交回复
热议问题