美文网首页
2022-02-07 iOS 扩大view 点击区域

2022-02-07 iOS 扩大view 点击区域

作者: cc帅气的昵称 | 来源:发表于2022-02-11 17:02 被阅读0次

    - (BOOL)pointInside:(CGPoint)pointwithEvent:(UIEvent*)event {

        CGRectbounds =self.bounds;

        //扩大原热区直径至30,可以暴露个接口,用来设置需要扩大的半径。

        CGFloatwidthDelta =30;

        CGFloatheightDelta =30;

        bounds =CGRectInset(bounds, -0.5* widthDelta, -0.5* heightDelta);

        returnCGRectContainsPoint(bounds, point);

    }

    相关文章

      网友评论

          本文标题:2022-02-07 iOS 扩大view 点击区域

          本文链接:https://www.haomeiwen.com/subject/zphmkrtx.html