0
votes

I have a uiscrollview, with content-size as

scrollView.contentSize = CGSizeMake(self.view.frame.size.height*3, self.view.frame.size.height);

that is 3 pages horizontally and I can scroll horizontally.

My question is, How can I make this scrollview draggable vertically exactly like UIWebView?

1
Is your content taller than the scrollview frame?spring
no, it is the same height, I can scroll horizontally just fine. It is an reading book app, so paging next/previous is working now. The thing is, I want make the scrollview vertically draggable, like what the UIWebView does, you can always draggable the uiwebview vertically.yincan
If the content is the same height as the scrollView, what is the user going to scroll to? That's that part I am not getting. But if you want just white (or any background color) space above and below the content, just set your content size.height larger than the scrollView and then the user can scroll up and down. You will need to position things to center the content, etc.spring
I can scroll horizontally because the width is large than the container's width. that's true. But I want the scrollview can be draggable away from the top, like pull-to-refresh on the table-view. but the height is the same as the container's height. maybe I can use the the UIPanGestureRecognizer, but it does not work pretty well. what I want is something like smooth-draggable like uiwebview. Maybe I can consider having two scrollview, put the one into another.yincan

1 Answers

0
votes

Am not sure i understand what you want to do, but wont

scrollView.contentSize = CGSizeMake(self.view.frame.size.height*3, self.view.frame.size.height *3);

Work with you? or what else are you trying to achieve