How to fill the remaining space between two layouts

心已入冬 提交于 2019-12-10 16:33:01

问题


I've got a problem concerning android layouts.

In my xml file I have two relative layouts. One is attached to the top by android:layout_alignParentTop="true".

The other one is attached to the bottom by android:layout_alignParentBottom="true".

Now there's a lot of space between these two views. I'd like two fill this remaining space with a FrameLayout where a couple of different fragments should be displayed.

Does anybody know how to fill the space I described?

Thanks a lot!


回答1:


<FrameLayout android:layout_below="@+id/toplayout" 
   android:layout_above="@+id/bottomlayout"/>



回答2:


add your frame layout and set its property

< android:layout_above="@+id/top"
     android:layout_below="@+id/bottom" >

so the frame layout will occupy thw whole space between these two layouts



来源:https://stackoverflow.com/questions/9700886/how-to-fill-the-remaining-space-between-two-layouts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!