1
votes

Can some one please tell me how to do this. My scrollView width is 600 and I'm going to 3 UIViews which has width of 800. Please note that this is a iPad app. Unfortunately I cant change the width of scrollView or UIView. I want to scroll through the one UIView completely without changing the page. If user drag further scrollview should jump to the second view. I want to do this by enabling paging in the scroll view.So there will be 3pages not 4. Is this possible.

2
It is for UIView width less than the UIScrollView's width right? I need it to do other way arround. UIView's width is greater than the scrollview's width - nath
once you enable the pagging the thing you want is difficult to achive, but you can to this by your own without paggin - CoolMonster

2 Answers

2
votes

Updating my answer according to your updated question.
1- first we add a scrollView (outer scrollView) with any frame you like

2- inside this scrollView (the outer) there is 3 inner-scrollViews with frame.size.width = outerScrollView.frame.size.width.

3- every inner scrollView has a standard scrolling behaviour (not paging) and the contentSize.width of them is equal to the yourView.size.width (lets assume 800 as in your question)

4- add every view on different inner-scrollView and then add these scrollViews(with view as a subview) on the outer-scrollView with paging enabled. The contentSize of the outer scrollView is equal to = outerScrollView.frame.size.with * 3.

Now you should have the inner-ScrollView scrollable to the size of your view, and when you reach the end of the contentSize the outer scrollview will change to the next page.

0
votes

The contentSize must be greater than the UIScrollView width or it won't scroll.

Create a UIView with width 2400 that contains your 3 UIViews. Add that UIView container to the UIScrollView and set the UIScrollView contentSize to 2400 width.