2011-04-11 93 views
0

我有一個滾動視圖中,我有一個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> 
+0

你可能要張貼多一點點的佈局XML代碼。這一行並沒有真正告訴我們任何事情 – FoamyGuy 2011-04-11 14:17:42

回答

1

從你LinearLayout刪除android:layout_weight="1"如果你想讓它變得高度爲0,如果沒有視圖中可見。