0
我有18個按鈕的屏幕,是否有可能使這組按鈕可滾動,以便用戶可以看到超出可視區域的按鈕。我試圖把這些按鈕放在ScrollView中,但得到了只有它們只能是滾動視圖的1個子項的異常。製作屏幕上的按鈕可滾動
目前的按鈕存在於RelativeLayout的像:
<Button
android:id="@+id/btnChapter2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnChapter1"
android:layout_below="@+id/btnChapter1"
android:text="Chapter 2" />
<Button
android:id="@+id/btnChapter3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnChapter2"
android:layout_below="@+id/btnChapter2"
android:text="Chapter 3" />
<Button
android:id="@+id/btnChapter4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnChapter3"
android:layout_below="@+id/btnChapter3"
android:text="Chapter 4" />
<Button
android:id="@+id/btnChapter5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnChapter4"
android:layout_below="@+id/btnChapter4"
android:text="Chapter 5" />
<Button
android:id="@+id/btnChapter6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/btnChapter5"
android:layout_below="@+id/btnChapter5"
android:text="Chapter 6" />
當前屏幕的按鈕9,17和18被擰起來看起來: