我需要在我的列表视图中完全禁用过度滚动,以便我可以实现自己的过度滚动功能。
在查看核心列表视图类时似乎很简单,只需将overscroll
模式设置为 OVERSCROLL_NEVER即可。我的三星Galaxy s2上的这个很好的工作。但对Galaxy Tab 2.3.3.
不起作用
有没有人对三星ListView自定义有很多经验可以帮助我?
它在三星Galaxy Tab(使用Android 2.2)上为我工作:
try {
// list you want to disable overscroll
// replace 'R.id.services' with your list id
ListView listView = ((ListView)findViewById(R.id.services));
// find the method
Method setEnableExcessScroll =
listView.getClass().getMethod("setEnableExcessScroll", Boolean.TYPE);
// call the method with parameter set to false
setEnableExcessScroll.invoke(listView, Boolean.valueOf(false));
}
catch (SecurityException e) {}
catch (NoSuchMethodException e) {}
catch (IllegalArgumentException e) {}
catch (IllegalAccessException e) {}
catch (InvocationTargetException e) {}