[英]UIVisualEffectView Mask not working on iPhone 7 Plus Simulator
[英]UIVisualEffectView not working on iPhone 6
在iPhone 6 / 6S上运行时, UIVisualEffectView
似乎不会模糊背景。 在Apple Developer Forum上 ,我只看到一个人提到这一点,但这里没有。
我编写了一个示例项目来演示这一点。 您所要做的就是在实际的iPad和iPhone 6上运行此操作,您将看到。 请注意,您需要在项目中添加图片。
它在模拟器中可以正常工作,但是在实际的iPhone 6或6S上运行时,模糊视图是不透明的。
我的简单视图控制器:
class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let effectView = UIVisualEffectView.init(effect: UIBlurEffect.init(style: .Light)) effectView.frame = CGRectMake(20, 100, 200, 200) let imageView = UIImageView.init(image: UIImage(named: "image")) imageView.contentMode = UIViewContentMode.ScaleAspectFill imageView.frame = self.view.bounds self.view.addSubview(imageView) self.view.addSubview(effectView) } }
我正在使用Xcode 7 GM,并在iPad Mini 2和iPhone 6S上都运行iOS 9.0.2。
我在iPhone的“辅助功能”设置中关闭了“降低透明度”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.