0
我有一個UIPageViewController,每個頁面包含頁面上的多個UIViews,每個UIView允許在長按手勢後的Pan手勢,我在contentVC中使用下面的委託,但它出現了pageVC不關心我的限制,它繼續翻頁!當我在平移時,是否必須做任何事情來禁用翻頁? (不得已將設置在PageVC像canTurn的變量,並將其設置爲NO,而平移是在行動....禁用UIPageViewController手勢識別器,同時處理longPressed手勢
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]] &&
[otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
return YES;
}
return NO;
}
什麼PageVC? PageViewController的子類? –
是的UIPageViewController的子類 –
這是永遠不會被調用的。我應該首先設置gestureRecoqnizer委託嗎? –