我有30个图像按钮,要排列10列3行,但我无法安排滚动视图。请帮帮我。
答案 0 :(得分: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>