Setting alpha on UIView sets the alpha on its subviews which should not happen

前端 未结 10 2361
借酒劲吻你
借酒劲吻你 2020-12-13 01:29

According to the documentation for UIVIew @property(nonatomic) CGFloat alpha

The value of this property is a floating-point number in the

10条回答
  •  情歌与酒
    2020-12-13 01:59

    In Swift 4.2 and Xcode 10.1

    Don't add colour and alpha value through storyboard. Only programmatic approach will work in this case.

    transparentView.backgroundColor = UIColor.black.withAlphaComponent(0.5)
    

提交回复
热议问题