我想創建一個佈局寬度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);
將解決你的問題。它禁用了滾動,但我需要的其他功能正在工作。不知道它是否會適合您的需求..乾杯