How to control Android ListView scrolling speed
I found that I can control the scrolling speed of an Android ListView
using code like this in
a Fragment
:
@Override public void onStart() { super.onStart(); // scroll speed decreases as friction increases. a value of 2 worked // well in an emulator; i need to test it on a real device getListView().setFriction(ViewConfiguration.getScrollFriction() * 2); }
I did this because the default ListView
scroll speed is too fast by default, and as a result,
it’s hard on the eyes when you scroll through a lot of items.
时间: 2024-11-03 21:16:30