草庐IT

addedTouchArea

全部标签

iOS 增加 UITableViewCell 中 UIButton 的触摸区域

我的UITableViewCell中有一个UIButton我创建了一个UIButton的子类来覆盖pointInside函数:vartouchMargin:CGFloat=20.0overridefuncpointInside(point:CGPoint,withEventevent:UIEvent?)->Bool{letextendedArea=CGRectInset(self.bounds,-touchMargin,-touchMargin)returnCGRectContainsPoint(extendedArea,point)}但是,触摸区域不会增加。如果我在UIButton之

iOS 增加 UITableViewCell 中 UIButton 的触摸区域

我的UITableViewCell中有一个UIButton我创建了一个UIButton的子类来覆盖pointInside函数:vartouchMargin:CGFloat=20.0overridefuncpointInside(point:CGPoint,withEventevent:UIEvent?)->Bool{letextendedArea=CGRectInset(self.bounds,-touchMargin,-touchMargin)returnCGRectContainsPoint(extendedArea,point)}但是,触摸区域不会增加。如果我在UIButton之