[英]GestureProblem: method not disable its calling next view
I am using swap gesture its working fine in a view (Ex class A) but its call in another viewController (Ex - Class B, C). 我正在使用交换手势,它在一个视图中正常工作(例如A类),但是在另一个viewController中调用它(例如-B类,C类)。 I'm not using navigationController simply addView on view.. Code - 我不是在视图上使用NavigationController只是addView。代码-
swipeLeftRecognizer = nil;
swipeLeftRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
swipeLeftRecognizer.direction = UISwipeGestureRecognizerDirectionLeft;
swipeLeftRecognizer.numberOfTouchesRequired = 1;
swipeLeftRecognizer.delegate = self;
swipeLeftRecognizer.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeLeftRecognizer];
swipeRightRecognizer = nil;
swipeRightRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)];
swipeRightRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
swipeRightRecognizer.numberOfTouchesRequired = 1;
swipeRightRecognizer.delegate = self;
swipeRightRecognizer.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:swipeRightRecognizer];
Due to this i'm not enable give the action of Button in another view (B, C). 因此,我无法启用在另一个视图(B,C)中提供Button的操作。 Please tell me any solution. 请告诉我任何解决方案。
Set UserInteractionEnabled = NO
, on view where you don't want to receive user actions when other views are visible. 在不希望看到其他视图时要接收用户操作的视图上,设置UserInteractionEnabled = NO
。 And when you remove other views again enable. 并在删除其他视图时再次启用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.