开发者

Android ListView scrolling

I have an Android ListView with very tall rows and it like a vertical gallery of pictures. When I fling the view I would like it to precisely stop at t开发者_如何学Pythonhe start of each view. Currently it will go over the next view and stop betwen 2 views which is not the effect I want.

Is there a setting that I can use to make this happens?


setSelectionFromTop(int position, int y) will snap a list to position, selecting the element at position y and snapping the list to where the top of the selected element is y pixels from the top. Would that provide what you need?

I haven't tested it, but it seems that this combined with onScrollStateChanged or AdapterView.OnItemSelectedListener would give you a scrolling, snapping ListView.

I hope that's of some use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜