且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

以编程方式在ListView中设置位置,而无需滚动

更新时间:2021-06-26 23:04:56

AbsListView中有一个名为 smoothScrollToPositionFromTop()的方法,该方法需要 duration 参数.因此,如果将其设置为0,则无需滚动动画即可完成操作.

There is a method in AbsListView, called smoothScrollToPositionFromTop() and it takes duration parameter. So if you set it to 0, you may do it without scrolling, animation.

smoothScrollToPositionFromTop