开发中 常常会使父视图的透明度改变,而子视图不受父视图的影响,则下面这段代码可以完美解决....
fatherView.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.6];
给图片添加点击事件
//<span style="color: rgb(51, 51, 51); font-family: Verdana, sans-serif, 宋体; font-size: 13px; line-height: 23px;">该属性决定UIView是否接受并响应用户的交互 YES接受响应 UIImageView这个属性默认是NO 当你需要给图片添加点击事件的时候 要把这个属性设为YES</span>
myImageView.userInteractionEnabled = YES;
//初始化一个手指单击事件 方法为clickImageView
UITapGestureRecognizer * singeleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickImageView)];
//把这个事件 加到UIImageView上面 最后 再把那个clickUIImageView方法 实现
[stillImageView addGestureRecognizer:singeleTap];