成都创新互联网站制作重庆分公司

ios5.1UITapGestureRecognizerUIControlEventTouchUpInside

       在UIButton的superview中定义一个手势,在iOS5上UIButton事件不会被执行,会执行手势事件,iOS6上已经没有这个问题了,解决方法:

瑶海ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18980820575(备注:SSL证书合作)期待与您的合作!

       手势添加委托,委托方法:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    // test if our control subview is on-screen
    if (_view.superview != nil) {
        if ([touch.view isDescendantOfView:_view] && [touch.view isKindOfClass:[UIButton class]]) {
            // we touched our control surface
            return NO; // ignore the touch
        }
    }
    return YES; // handle the touch
}

这样手势不再执行,会执行UIButton的点击事件。


新闻标题:ios5.1UITapGestureRecognizerUIControlEventTouchUpInside
本文链接:http://cxhlcq.com/article/jppihd.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部