這是我寫的一個示例XML。我正在嘗試製作一個垂直對齊的按鈕列表,還有2個這樣的列。所以總共會有3列。每列都可以垂直滾動。你如何添加更多的列並讓它們單獨滾動?Android:創建多列按鈕,每個按鈕都有獨立的滾動視圖
我搜索並嘗試了其他幾種變化;我能找到的最接近桌面佈局,但是垂直滾動似乎不可能!
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/table"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="*">
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button1"/>
<Button
android:id="@+id/button2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button2"/>
<Button
android:id="@+id/button3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/button3"/>
</TableLayout>
你可以使用'ListView's,但我認爲並排多個列表對於小屏幕來說不是一個好主意。 –