我有以下線性佈局身高和體重
<linearLayout>
<RelativeLayout>
<!-- Header -->
</RelativeLayout>
<linearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="6">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
</LinearLayout>
</linearLayout>
但佈局不承擔填補了高度妥善我想爲一個的LinearLayout的預期效果低於另一個,並採取了母體空間的1/6。
相反,它似乎是將重量應用到元素的寬度。
在Android中假設百分比高度的正確方法是什麼?寬度似乎是一個輕而易舉的重量,但我似乎無法得到正確的高度。
對我來說看起來是正確的...哦,請嘗試在父LinearLayout上指定'orientation:vertical'。 –
我有同樣的問題,扭曲。在我的情況下,根linearlayout混合了線性佈局,framelayout和相對佈局。任何線索我要去哪裏錯了。我已經在所有線性佈局中指定了方向。 –