![](/img/trans.png)
[英]Using UIScrollView with UIVisualEffectView (UIBlurEffect) in Swift
[英]Swift UIVisualEffectView with UIBlurEffect not working
单击浮动操作按钮后,我试图显示UIView
。 有一次,我单击了渲染内容视图所需的浮动操作按钮。 现在,如果我尝试应用blur effect
,它不起作用。
这是我的代码:
fileprivate var parentView: UIView!
self.parentView = view
self.items = items
let bounds = self.parentView.bounds
self.contentView = UIView(frame: bounds)
self.blurVisualEffect = UIVisualEffectView(effect: UIBlurEffect(style: .extraLight))
self.blurVisualEffect.frame = self.contentView.frame
self.contentView.addSubview(self.blurVisualEffect)
尝试这个
let blurEffect = UIBlurEffect(style: .extraLight)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = self. parentView.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
self.contentView.addSubview(blurEffectView)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.