LinearLayout minHeight 不工作 weigth=“1”
我整个下午都试图让属性发挥作用。minHeight
我想要的是布局:linearMe
- 当 ListView 只有几个元素时,从屏幕底部拉伸到 ListView 的底部。
- 例如,我需要能够用图片填充linearMe布局。
随着 ListView 变得越来越大,我希望布局能够:linearMe
- 具有固定的高度(同时位于屏幕底部)和列表视图以允许滚动。
我的问题是布局越来越小,因为ListView中有更多的元素。当有足够的元素供 listView 填充屏幕时,布局就消失了。在这种情况下,看起来是无用的。linearMe
linearMe
minHeight
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:id="@+id/linearMe"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#FF0000"
android:minHeight="200dp" />
</LinearLayout>
我希望你能帮助我!:)