0

我有 30 个图像按钮,它们将排列 10 列和 3 行,但我无法安排滚动视图。请帮帮我。

4

1 回答 1

0

利用GridLayout

<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:app="http://schemas.android.com/apk/res/com.astuetz.viewpager.extensions.example">
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >



    <android.support.v7.widget.GridLayout
        android:layout_width="match_parent"
        android:layout_height="900dp" >

       <!-- your buttons -->

    </android.support.v7.widget.GridLayout>

</LinearLayout>

</HorizontalScrollView>
于 2013-10-08T06:56:25.457 回答