我有一个继承自
UIPageViewController
的viewController
(@interface PageScrollViewController:UIPageViewController
)。我想知道如何在UIPageViewController
中启用和禁用滚动。当使用UIScrollView
时,您可以执行setScrollEnabled:NO
,而self.view.userInteractionEnabled = NO;
不是选项,因为它会阻止整个UIView
而不仅仅是滚动。
编辑
这是在PageScrollViewController:UIPageViewController
类中:if ([[notification name] isEqualToString:@"NotificationDisable"]){
NSLog (@"Successfully received the disable notification!");
for (UIGestureRecognizer *recognizer in self.gestureRecognizers) {
recognizer.enabled = NO;
}
}
NSLog(@"Gesture recognizers: %@",self.gestureRecognizers)
。 - tilo