Disable Page scrolling in UIPageViewController [duplicate]

时间秒杀一切 提交于 2019-12-01 09:44:35

问题


I am working on app in which I'm using UIPageViewController. Now I want to disable page scrolling not Gestures. actually I want to draw signature in view that contain in UIPageViewController.For this I need to disable page scrolling. I've done Gesture disable but it is not what I want.

for (UIGestureRecognizer *recognizer in pageViewController.gestureRecognizers)
{
   recognizer.enabled = YES;
}

And I want it with the help of Edit button that when I press page scrolling disable and enable with pressing again. Any body can tell me How will it be possible.


回答1:


if You need to disable scrolling in UIPageViewController - You can return nil in data source methods:

- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController


来源:https://stackoverflow.com/questions/27171786/disable-page-scrolling-in-uipageviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!