tags:

views:

27

answers:

2

I have a HorizontalScrollView that consists of Images (Icons). I need to scroll the view in "blocks" the width of the icons, so as to never have a "piece" of the icon on the screen. I need more, but this question will give me all the other answers I need.

Does anyone have a code example to point me to for this?

Thank You in advance.

JS

A: 

You can either use a Gallery or create your own custom View that does this (maybe extend HorizontalScrollView).

Felix
Gallery does not quite act as I really need it to. Thank you for the advice, I had looked into using it previously. Given thought and a bit of number crunching, my posted method works wonderfully (and you did mention overriding HorizontalScrollView - which I had partially done).
Jeff
A: 

I accomplished this in two parts.

I dynamically add the buttons from resource files and account for spacing on the left, right, and between.

I modified HorizontalScrollView to simply scroll to one of X positions (whichever is closer to the currently stopped position).

Again, thanks for reading.

JS

Jeff