android - FramLayout : Fill empty space -
i have 3 framelayout
in layout, first , third have fixed height (wrap_content of child views).
and want second framelayout
fill remaining space between first , third element.
my xml :
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/root" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <framelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > // ... childs views fixed height </framelayout> <framelayout android:layout_width="match_parent" android:layout_height="0dp" <!-- fill remaining space --> android:layout_marginbottom="5dp" android:layout_margintop="5dp" > // ... childs views match_parent height </framelayout> <framelayout android:layout_width="match_parent" android:layout_height="wrap_content" > // ... childs view fixed height </framelayout> </linearlayout>
you can use layout_weight="1"
property central framelayout
, leaving 0dip
height
. take space left other two
Comments
Post a Comment