Tôi muốn gán trọng số bố cục cho một số mục trong một LinearLayout
bên trong của một ScrollView
. Tuy nhiên, số ScrollView
bỏ qua LinearLayout
weightSum
.Trọng lượng bố cục không hoạt động bên trong một ScrollView
Mục tiêu của tôi là chia bố cục với trọng số là 2, 1, 1 (với tổng số là 4), nhưng điều này không hoạt động chính xác bên trong số ScrollView
.
Làm cách nào để giải quyết vấn đề bố cục này?
main.xml
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="4">
<LinearLayout android:id="@+id/logo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="2"
android:background="#FFFFFF" />
<LinearLayout android:id="@+id/logo1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="1"
android:background="#000000" />
<LinearLayout android:id="@+id/logobutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:background="#4B4B4B" />
</LinearLayout>
</ScrollView>
nếu tôi đang loại bỏ chỉ scrollview hơn là công việc nhưng câu hỏi của tôi là nếu sáng sử dụng scrollview hơn không được làm việc –
việc kiểm tra này một: [Android Layout Trọng lượng] (http://stackoverflow.com/questions/4986861/ android-bố trí-trọng lượng) Tôi nghĩ rằng nó loại cùng một vấn đề. – user1264255