如何设置父视图透明,而内容不透明的方法
2017-07-08 本文已影响0人
小红猪大鼻孔
错误做法
self.view.backgroundColor = [UIColor whiteColor];
self.view.alpha = 0.5;
正确做法
self.view.background = [[UIColor whiteColor] colorWithAlphaComponent:0.5];
self.view.backgroundColor = [UIColor whiteColor];
self.view.alpha = 0.5;
self.view.background = [[UIColor whiteColor] colorWithAlphaComponent:0.5];