What is the alternative to putting UIWebView inside UIScrollView
I have gotten UIWebView inside UIScrollView to work, so far anyways, and I have just seen mention on Apple's site that doing so is not advised.
So OK, what's the alternative? I need to display web pages, and I need them to be scrollable, such that if the user swip开发者_如何学Pythones leftward then an entirely different page appears coming in from the right. And a reverse situation with swiping rightward.
How is that done without putting UIWebView inside UIScrollView?
Thanks.
Well, you need the UIWebView
, which has indeed many features of a UIScrollView
, to be able to scroll not only up and down, but also to left and right.
Also, scrolling with two fingers is a no-go, for scrollable elements within a web page, such as textarea
s can only be scrolled with two fingers.
Three fingers is also not so good because that's not convenient for people with thick fingers...
So my suggestion is that you add a UIGestureRecognizer
to your UIWebView
and look out for a swipe gesture. Then handle the switching of pages accordingly with animations.
精彩评论