开发者

Manually Paging in uiscrollview

I have a scrollview with lets say ten subviews in it. All are shown at the same time. I want to page between each subview.

One idea is to set the frame size equal to a single subview and turn the paging on. But then it will receive the touch only within that frame. I want the user should be able to scroll it from any where 开发者_如何学运维in that scrollview.

For Example:

| sub1 sub2 sub3 sub4 sub5 sub6 sub7 sub8 sub9 sub10 |

I want the user to scroll it from any where in this scrollview, and page between these subviews.

Any Idea?


I think what you want is this.


make a frame that is the size of the subviews (frame) and then set these:

scrollview.pagingEnables = YES;
scrollview.contentSize = CGSizeMake(frame.size.width*numberofsubviews,  frame.size.height);

The UIScrollView should handle everything else from there on out.

The link that Toro sent you will help a great deal, I wouldn't avoid that if I were you

This link will help as well PhotoScroller

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜