fatherview.backgroundColor= [[UIColorblackColor]colorWithAlphaComponent:0.5];
通过该方法可以设置父视图的透明度,而且不会影响到子视图。另外需要注意的一点是如果使用了xib或者stroyboard画的视图,还需要在xib中将fatherview写成clearcolor,然后透明度写成1.
fatherview.backgroundColor= [[UIColorblackColor]colorWithAlphaComponent:0.5];
通过该方法可以设置父视图的透明度,而且不会影响到子视图。另外需要注意的一点是如果使用了xib或者stroyboard画的视图,还需要在xib中将fatherview写成clearcolor,然后透明度写成1.
本文标题:如何实现父设置Alpha值的时候不影响子视图
本文链接:https://www.haomeiwen.com/subject/aqicnttx.html
网友评论