开发者

iphone uiscrollview - custom paging distance

I have a long UIScrollView that I want to page through by a variable amount (I have images of different widths that I want to center on screen as the user scrolls through with paging enabled:

From the UIScrollView Class Reference for pagingEnabled: the scroll view stops on multiples of the view bounds when the user scrolls.

So I guess I need to keep changing the bounds of the scroll view? I can do that, but say my scroll view's开发者_如何学Python frame is 1024px wide (on the iPad) and I want to set the paging so that the next image which is 500px wide gets centered. If I change the bounds of the scroll view to 500px wide, then it no longer responds to touches in the rest of the 1024px wide frame. Any ideas how to get around that?


why bother changing the size of the scrollview?

won't... [imageView setCenter:CGPointMake(((pageYouAreOn*scrollViewWidth)-(scrollViewWidth/2.0f)),(scrollViewHeight/2.0f))]; (or similar) work?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜