UIVisualEffectView not working on iPhone 6

It seems that UIVisualEffectView does not blur the background when working on the iPhone 6 / 6S. I just saw someone mention this in the Apple Developer Forums , but there is nothing here.

I wrote a sample project to demonstrate this. All you have to do is run this on a real iPad and iPhone 6, and you will see. Please note that you need to add an image to your project.

It works great in a simulator, but the blur appears opaque when run on a real iPhone 6 or 6S.

My simple controller:

  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)
   }

 }

I use Xcode 7 GM and run iOS 9.0.2 on the iPad Mini 2 and iPhone 6S.

+5
source share
1 answer

I have reduced transparency, disabled in the accessibility settings of the iPhone.

0
source

Source: https://habr.com/ru/post/1232665/


All Articles