如图,我将右上角的UIButton 添加到里面的白色的UIView上面,可以看出来这个button有部分是在UIView外面的。我代码是:[contentView addSubview:button];
[button addTarget:self selector......]
现在问题就是,button在这个白色view外面的部分不能响应点击事件,只有在白色view内部的4/1圆里面可以接收到点击时间。我想让button整个都能收到点击事件。该怎么破
大家讲道理2017-04-17 15:10:27
The first method is to put your display animation and cross button into a view, and add the button to the view; the second method is to reset the hotspot area of your contentview
高洛峰2017-04-17 15:10:27
The current problem is that the superview area of button
is too small and blocks the response of the button. Just lift the button above it. There are many solutions.
button
to contentView.superview
, but you need to reset button.frame
.