如何在网格视图中添加滚动条?
答
将您的网格视图换成滚动视图。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:paddingTop="10dip"
android:paddingLeft="5dip"
android:layout_weight="1"
>
</ScrollView>
答
我想补充的gridview的滚动条,我怎么能在网格视图中添加滚动条?
GridView
GridView
已经有一个滚动条,所以没有什么是你需要做的。在Android 2.2中,当用户主动滑动网格时,该条只会默认显示。您可以使用一系列attributes defined on the View
class来定制滚动条的行为。
不要这样做。 'GridView'已经知道如何滚动。 – CommonsWare 2010-09-08 19:47:02
GridView基本上是一个带有列的ListView。所有相同的概念都适用。将ListView或GridView放入ScrollView就像试图用正则表达式解析HTML一样。你的唯一奖励将是痛苦和痛苦。 – adamp 2010-09-08 23:06:40