【发布时间】:2015-11-06 19:20:22
【问题描述】:
我有一个 ContainerView 有两个子视图 A 和 B,A is a TableViewController 和 B is a CollectionViewController。
在 B 中,当我 press on a collectionViewCell 加载了一个 detailView。 detailView 是一个简单的 UIViewController 和 UIImageView。
我在 B 上设置了 UISwipeGesture 以在左侧显示 tableViewController A。
我需要什么
现在我不想在 detailView 上显示 tableViewController,
所以我需要禁用 UISwipegesture 但只有当我在 detailView
我做了什么
我已经设置了 UIGestureDelegate 但没有调用委托方法。
使用 userInteractionEnambled=NO 没有任何变化,除非我在 detailView 中插入以下行 myContainerViewController.view.userInteractionEnambled=NO;
提前致谢
【问题讨论】:
-
你能发布一些你的代码并重新格式化你的问题吗?
-
为手势识别器设置代理是处理此问题的适当方法。您需要在您的委托中实现
gestureRecognizer:shouldReceiveTouch:。 -
我已经尝试过了,但我无法调用该方法。我放了 myGetsure.delegate=self 和
但什么也没发生
标签: ios xcode uitableview uiviewcontroller uigesturerecognizer