[英]UIScrollView and UIButton touch up in side event conflict
I hava a TableViewController, When I tap on a cell it pushed into a detail controller. 我有一个TableViewController,当我点击一个单元格时,它推入了一个细节控制器。 On the detail controller, I have a scrollview and a UIButton on it.
在详细信息控制器上,我有一个scrollview和一个UIButton。 I want single tap on the scrollview to back to TableView and touch the UIButton to do other things.
我希望在滚动视图上单击以返回TableView并触摸UIButton来执行其他操作。 In the detail controller:
在详细信息控制器中:
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action: @selector(singleTap:)];
tapRecognizer.cancelsTouchesInView = NO;
[self.scrollView addGestureRecognizer:tapRecognizer];
Now, when I tap the scrollview it back to tableview, but when I tap the UIButton, It also back to tableview, How to fix it? 现在,当我点击滚动视图时,它又回到了桌面视图,但是当我点击UIButton时,它又回到了桌面视图,如何解决? Thank you.
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.