views:

36

answers:

2

hello all,

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?

+1  A: 

I think what you want is this.

Toro
A: 

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

Daniel Hanly