How to correctly set alpha of UIView? [iOS]

混江龙づ霸主 提交于 2019-12-03 13:57:38
 [view setBackgroundColor:[[UIColor clearColor] colorWithAlphaComponent:0.5]];

 //try this.. dont try to set alpha of UIView and also your subviews will not affect
myView.layer.shouldRasterize = YES

This will make it use group opacity and everything should composite as you'd expect.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!