UIWebView page navigation - e.g. setPagingEnabled

Is there a way to navigate a webview using swap, for example UIScrollView "pagingEnabled"?

There are some tips for setting this option in UIWebViews scroll view, but this solution does not work, for example. in case you set the webcontent offset using javascript. In this case, the first press on the screen will cause you to return to the top of the page ....

Are there any recommended ways to do this right?

Update
My initial problem, of course, was that I set the paging to turn on and set the content offset to a number not equal to the actual page border ...

The question remains, although there is a better way to accomplish this task.

+6
iphone cocoa-touch ipad uiwebview
source share
2 answers

Yes, there is a way. Set the web set CSS to a stream with multiple columns.

-webkit-column-width 

Use javascript 'scrollTo' to go to next / previous page

 window.scrollTo(xPagePosition, 0) 

Add a UIView with a clear background color on top of the UIView to capture user gestures.

+2
source share

Since iOS 7, UIWebView has paginationMode . Note that you need to set pagingEnabled in pagingEnabled web scrollView .

This feature is not published in the new WKWebView , but appears to be present in the private API .

0
source share

All Articles