Showing pdf in uiwebview on ios9, sometimes scrolling stuck

I am working on an ios application written in swift, xcode7

The view is UIWebView.

using loadRequest(NSURLRequest), we download the PDF file from disk. This works fine, but sometimes the PDF file cannot be scrolled behind the first page or what you see first on the screen. I cannot determine what causes the non-scroll, as sometimes I open the same file again and then it scrolls.

An attempt to scroll when it does not want to bounce the bottom of the screen, and you can see that there is another page, but you cannot scroll to the window.

UIScrollViewcontained inside UIWebView(this is the default) knows that there are more pages because "1 of 3" is displayed on the screen.

UIWebView

  • has the flag "scale the page to fit"
  • verified "user interaction"
  • has a "multiple touch" not verified
  • verified function "autoresize subviews"
  • has a "Zoom to fill" mode

I tried the following:

  • checking if scrollview is not larger than the screen by placing a border around it: no, it fits on the screen and is as important as you would expect
  • setting internal UIScrollView.scollEnabledto true in code

In the application, when displayed, UIWebViewit changes on the screen, folding the element above it, but I tested it with fixed heights and did not change anything.

flashScrollIndicators() UIScrollView, . , , . , .

, ?

+4
2

, pdf UIWebView , "about: blank", -. pdf , , scrollview.

, "" pdf (, , , ), : blank, pdf , - .

+2

UIWebView. , :

  • ? ( )

  • flashScrollIndicators UIScrollView . UIScrollView a nil?

WKWebView. . iOS.

CoreGraphics, PDF , ( ). , CocoaPod Carthage, .

+2

Source: https://habr.com/ru/post/1630070/


All Articles