比如说上边有个标题栏,底部有个信息栏,中间一个framelayout,这个framelayout如何设置填充除标题栏和底部信息栏之外的中间位置?
顶部<linearlayout android:layout_height="固定高度/>
中间<framelayout android:layout_height="wrap_content"
android:layout_weight="1"//关键设置这个属性
底部 <linearlayout android:layout_height="固定高度/>
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:text="顶部标题"
android:background="@android:color/holo_green_dark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="底部信息栏"
android:layout_alignParentBottom="true"
android:background="@android:color/holo_green_dark"/>
</ RelativiLayout>
android:text="顶部标题"
android:background="@android:color/holo_green_dark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"/>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ic_launcher">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="底部信息栏"
android:layout_alignParentBottom="true"
android:background="@android:color/holo_green_dark"/>
.
有一个技巧,比如如果height或者width为0,那么设置weight=1,这个控件将填充剩余的部分