iPhone: scroll view with arbitrary page/"settling" boundaries?

Posted by Ben on Stack Overflow See other posts from Stack Overflow or by Ben
Published on 2010-03-23T19:22:13Z Indexed on 2010/03/23 19:23 UTC
Read the original article Hit count: 315

Filed under:
|
|

Hi all, I'm trying to figure out if I can get what I want out of UIScrollView through some trickery or whether I need to roll my own scroll view:

I have a series of items in row that I want to scroll through. One item should always be centered in the view, but other items should be visible to either side. In other words, I want normal scrolling and edge bouncing, but I want the deceleration when the user ends a touch to naturally settle at some specified stop point. (Actually now that I think of it, this behavior is similar to coverflow in this respect.)

I know UIScrollView doesn't do this out of the box, but does anyone have suggestions for how it might be made to do this, or if anyone's spotted any code that accomplishes something similar (I'm loathe to reimplement all the math for deceleration and edge bounce)

Thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiscrollview