我知道在iOS5中,UIScrollVIEw可以在完成之后以某种方式将触摸事件传递给控件层次结构.任何人都可以帮我弄清楚如何做到这一点?
解决方法 将UIGestureRecognizer属性cancelstouchesInVIEw设置为NO.UITapGestureRecognizer *singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTap:)];singleTapGestureRecognizer.numberOfTapsrequired = 1;singleTapGestureRecognizer.enabled = YES;singleTapGestureRecognizer.cancelstouchesInVIEw = NO;[tapableVIEw addGestureRecognizer:singleTapGestureRecognizer];[singleTapGestureRecognizer release];
从UIGestureRecognizer Class Reference起
总结A Boolean value affecting whether touches are
delivered to a vIEw when a gesture is recognized.When this property is YES (the default) and the receiver recognizes its gesture,the touches of that gesture that are pending are not delivered to the vIEw and prevIoUsly delivered touches are cancelled through a touchesCancelled:withEvent: message sent to the vIEw. If a gesture recognizer doesn’t recognize its gesture or if the value of this property is NO,the vIEw receives all touches in the multi-touch sequence.
以上是内存溢出为你收集整理的用于UIScrollView的iOS5 UITapRecognizer干扰按钮.怎么修?全部内容,希望文章能够帮你解决用于UIScrollView的iOS5 UITapRecognizer干扰按钮.怎么修?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)