Tôi đã sautuyến tính Layout Chiều cao và cân
<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>
Tuy nhiên việc bố trí không được giả định để lấp đầy chiều cao đúng cách tôi muốn cho hiệu quả mong muốn của một LinearLayout dưới đây khác và để mất 1/6 của không gian cha mẹ.
Thay vào đó, dường như áp dụng trọng số cho chiều rộng của phần tử.
Phương pháp chính xác để giả định chiều cao phần trăm trong Android là gì? Chiều rộng có vẻ là một khoe với trọng lượng nhưng tôi không thể có vẻ để làm cho nó chính xác về chiều cao.
Có vẻ đúng với tôi ... Ồ, thử chỉ định 'hướng: dọc' trên" LinearLayout "gốc. –
Tôi có cùng một vấn đề, với một twist. Trong trường hợp của tôi, linearlayout gốc có sự kết hợp của layout tuyến tính, framelayout và layout tương đối. Bất kỳ đầu mối nào tôi đang đi sai. Tôi đã chỉ định hướng trong tất cả bố cục tuyến tính. –