【问题标题】:Disable Page scrolling in UIPageViewController [duplicate]在 UIPageViewController 中禁用页面滚动 [重复]
【发布时间】:2014-11-27 22:51:52
【问题描述】:
我正在开发使用 UIPageViewController 的应用程序。现在我想禁用页面滚动而不是手势。实际上我想在包含 UIPageViewController 的视图中绘制签名。为此,我需要禁用页面滚动。
我已经禁用了手势,但这不是我想要的。
for (UIGestureRecognizer *recognizer in pageViewController.gestureRecognizers)
{
recognizer.enabled = YES;
}
我希望借助编辑按钮,当我按下页面滚动禁用并再次按下启用时。
任何人都可以告诉我这怎么可能。
【问题讨论】:
标签:
ios
objective-c
uipageviewcontroller
【解决方案1】:
如果您需要在 UIPageViewController 中禁用滚动 - 您可以在数据源方法中返回 nil:
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController