UIScrollView cancels UIPageViewController gestures when scrolling

前端 未结 3 601
死守一世寂寞
死守一世寂寞 2021-01-13 14:47

I have a UIPageViewController that handles turning the pages of my \"book\". However, each book page is a ViewController with a UIScrollView

3条回答
  •  失恋的感觉
    2021-01-13 14:48

    I had the same issue and I worked my way around... in my case I have pdf with zooming enabled. So I have for example:

    [scrollView setMaximumZoomScale:6];
    [scrollView setMinimumZoomScale:1];
    

    when I initialize the controller and its scrollView, and just after that and every time I change orientation or page I change the zoom to fit the width of the page, only if the zoom is "far away"

    CGFloat desiredWidth = scrollView.frame.size.width/pdfRect.size.width;
    if (desiredWidth>[self zoomScale]) {
        [scrollView setZoomScale:desiredWidth animated:YES];
    }
    

    I hope it helps

提交回复
热议问题