在UIPageViewController中禁用页面滚动 [英] Disable Page scrolling in UIPageViewController

查看:125
本文介绍了在UIPageViewController中禁用页面滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UIPageViewController的应用程序上工作.现在我要禁用页面滚动而不是手势.实际上我想在包含在UIPageViewController中的视图中绘制签名.为此,我需要禁用页面滚动. 我已经完成了手势禁用功能,但这不是我想要的.

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.

推荐答案

如果需要在UIPageViewController中禁用滚动-您可以在数据源方法中返回nil:

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

这篇关于在UIPageViewController中禁用页面滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆