我想创建一个布局宽度GridView,它接受整个屏幕(fill_parent用于宽度和高度)。 列数为X,行数为Y(填充自己的适配器,扩展BaseAdapter)。 我不想要的是滚动。我想让所有项目都可见,没有垂直滚动条。没有滚动的GridView
在此先感谢。
我想创建一个布局宽度GridView,它接受整个屏幕(fill_parent用于宽度和高度)。 列数为X,行数为Y(填充自己的适配器,扩展BaseAdapter)。 我不想要的是滚动。我想让所有项目都可见,没有垂直滚动条。没有滚动的GridView
在此先感谢。
尝试设置以下OnTouchListener
:
gridView.setOnTouchListener(new OnTouchListener(){
public boolean onTouch(View v, MotionEvent event) {
return event.getAction() == MotionEvent.ACTION_MOVE);
}
});
集属性的android:scrollingCache = “假”,在你的GridView
<ListView android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollingCache="false"
android:layout_weight="1" />
..maybe:
mKeypadGrid.setEnabled(false);
将解决你的问题。它禁用了滚动,但我需要的其他功能正在工作。不知道它是否会适合您的需求..干杯