Apple ZoomingPDFViewer will not allow to drag until the first increase

I use this sample code to view a PDF file in an application for iPhone:

http://developer.apple.com/library/ios/#samplecode/ZoomingPDFViewer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010281-Intro-DontLinkElementID_2

However, the problem is that I cannot get it to drag first. At first I can pinch and scale, and after I zoom in once, I can just drag the view. I just can't drag when the view first loads.

Any ideas?

+4
source share
4 answers

I think I understood the solution, but why doesn’t it just work outside of me. If you set the zoomScale property, it seems to invoke everything you need to allow drag and drop, even if you set property 1, which does nothing.

I just did this in the initWithFrame: UIScrollView method:

... self.zoomScale = 1; ... 

If anyone else knows of any correct or more correct way to do this or explains why this is happening, I would like to know.

+2
source

Setting the uiscrollview scaling to 1 in the initFrame PDFScrollView (just as suggested above) doesn't make the view scrollable on load for me? Did you also make any other changes?

If you can find out why this is happening, let me know ...

0
source

This is because pdf is a "feature". once you get above the scale of 1.0, the page will always be in the center of the screen and you will not be able to drag it. Thus, when you zoom out beyond 1.0f (after the initial zoom), it will no longer allow you to move around.

I think the layoutSubviews method is what does this - although I'm not sure. This is a method that supports content at least.

0
source

Stuck in this problem for almost the whole day. In the rightmost window, click on the left button like this: screenshot

Then uncheck "Use self-timer"

0
source

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


All Articles