android 控制listview 的滑动速度

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.

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。