var controllerScreen = UIImageView()
controllerScreen.backgroundColor = UIColor.redColor()
这会为 UIImageView 添加不透明的红色。我想添加一种透明的红色。有没有透明属性之类的?
最佳答案
作为@AdamPro13 的替代方案,您可以这样做:
controllerScreen.backgroundColor = UIColor.redColor().colorWithAlphaComponent(0.5)
关于ios - Swift 给 UIImageView 背景添加透明色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30221528/