UIImageView添加UIButton时,按钮点击事件无效

来源:互联网 发布:js秒杀倒计时代码 编辑:程序博客网 时间:2024/05/22 05:17

UIImageView的userInteractionEnabled默认为no。

所以添加上去的按钮都无法响应点击。

解决方法:UIImageView的userInteractionEnabled设置为yes

0 0