2011-06-27 36 views

回答

4

編輯: 我的錯誤,我誤解了這個問題。

負值似乎代表match_parent,wrap_content和fill_parent。

當應用-1或-2時,視圖就像填充match_parent或fill_parent一樣填充屏幕。當應用任何數字-3或更低時,行爲與wrap_content相同。

這些值與layout_weight無關,只是Android中寬度和高度的預定義常量。

+1

因爲它是目前編寫的,您的代碼在Eclipse中爲我生成錯誤。 android:layout_width =「 - 1」無效。爲了我的回答,我假設你的意思是android:layout_width =「 - 1dp」。 – theisenp