これに関する多くの投稿を見て、多くの解決策を試しましたが、何らかの理由で何も機能していません. ボタンが同じスペースを共有するようにしたいだけです...私のxmlコードを見て、何か問題があるかどうかを確認してください。ありがとう!
<ScrollView android:id="@+id/scrollview1"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:weightSum="120">
<Button android:id="@+id/btn_mission" android:layout_width="0dp"
android:layout_height="wrap_content" android:background="#8D8BB7"
android:layout_weight="20" android:text="Mission">
</Button>
<Button android:id="@+id/btn_news" android:layout_width="0dp"
android:layout_height="wrap_content" android:background="#8D8BB7"
android:layout_weight="20" android:text="News/Events">
</Button>
<Button android:id="@+id/btn_studentservices"
android:layout_width="0dp" android:layout_height="wrap_content"
android:background="#8D8BB7" android:layout_weight="20"
android:text="Student Services">
</Button>
<Button android:id="@+id/btn_facultyservices"
android:layout_width="0dp" android:layout_height="wrap_content"
android:background="#8D8BB7" android:layout_weight="20"
android:text="Faculty Services">
</Button>
<Button android:id="@+id/btn_staff" android:layout_width="0dp"
android:layout_height="wrap_content" android:background="#8D8BB7"
android:layout_weight="20" android:text="Staff">
</Button>
<Button android:id="@+id/btn_library" android:layout_width="0dp"
android:layout_height="wrap_content" android:background="#8D8BB7"
android:layout_weight="20" android:text="Library">
</Button>
</LinearLayout>
</ScrollView>
</LinearLayout>
編集:背景を設定することと関係があるようです。背景を削除し、スクロールする必要があることを除いて、すべてが等しいスペースを共有しました。