Android的 - 布局高度不更新
问题描述:
我有一个滚动视图中,我有一个LinearLayout中。 LinearLayout有一些意见。 对于前: - 我的LinearLayout高度为100 之后我删除从LinearLayout中的所有视图还我得到同样的高度为100 如何更新当前高度。当没有视图存在时,这是0。Android的 - 布局高度不更新
我的代码:
<ScrollView android:layout_weight="1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:fillViewport="true">
<LinearLayout android:layout_weight="1"
android:layout_width="fill_parent"
android:orientation="vertical" android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
答
从你LinearLayout
删除android:layout_weight="1"
如果你想让它变得高度为0,如果没有视图中可见。
你可能要张贴多一点点的布局XML代码。这一行并没有真正告诉我们任何事情 – FoamyGuy 2011-04-11 14:17:42