增大view的响应范围

ios 响应链

#pragma mark 增大cell的响应范围(删除按钮) 每次只要查到这里 立马拦截
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
    CGPoint pointInButton = [self convertPoint:point toView:self.deleteBigButton];
    return [self.deleteBigButton pointInside:pointInButton withEvent:event] ? self.deleteBigButton : [super hitTest:point withEvent:event];
}
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
    CGPoint pointInButton = [self convertPoint:point toView:self.deleteBigButton];
    BOOL canDid =  [self.deleteBigButton pointInside:pointInButton withEvent:event];
    if (!canDid) {
        return [super pointInside:point withEvent:event];
    }
    return canDid;
}
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 问题演示 我们经常看到这样的app,它的tabBar上中间的按钮超出了tabBar的范围,但是我们在实际做的时候会...
    BrightFuture阅读 12,224评论 12赞 25
  • 拔牙是一件很令人害怕的事情。 昨天下午与牙医约好,交了定金,当时心情还比较平静,我又不是小孩子,不应该该怕的。今天...
    怪兽在这儿阅读 565评论 0赞 0
  • 我得是有多忙,好几天没写简书了,高级去咯大概有一个月没休息了,几乎每天都在紧张的工作中,一天十几个小时,昨晚甚至到...
    Smile_Zhangjie阅读 332评论 4赞 1
  • 一、今天,我最大的感受是:1.了解了自己在教学授课中的不足,如:七步教学法中课堂落实之学生分组以教为学,对于生生互...
    零度_6335阅读 323评论 4赞 1
  • 2017.5.3 今天晚上的雨很大,和冬瓜交流得鸡同鸭讲之后,准备借钱打的回去。我们在红路灯的斑马线路口打的,可能...
    徽城巷子阅读 368评论 0赞 0

友情链接更多精彩内容