Scrolling Android ListViews

I have an Android ListView with very high rows, and it looks like a vertical gallery of pictures. When I glance, I would like him to stop at the beginning of each view. Currently, he will move on to the next view and stop two types of viewing, which is not the effect that I want.

Is there a parameter that I can use to make this happen?

+4
source share
1 answer

setSelectionFromTop (int position, int y) will snap the list to the position, selecting the element at position y and tying the list to where the vertex of the selected element is y pixels from above. Will this provide what you need?

I have not tested it, but it looks like this combined with onScrollStateChanged or AdapterView.OnItemSelectedListener will give you a scroll and ListView binding.

I hope this will be helpful.

+1
source

All Articles