您的位置:首页 > 产品设计 > UI/UE

iOS扩大按钮UIButton的点击范围

2016-10-26 15:52 771 查看
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event

{

CGRectbounds =self.bounds;

CGFloatwidthDelta =44.0- bounds.size.width;

CGFloatheightDelta =44.0- bounds.size.height;

bounds =CGRectInset(bounds, -0.5* widthDelta, -0.5* heightDelta);//注意这里是负数,扩大了之前的bounds的范围

returnCGRectContainsPoint(bounds, point);

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: