简体   繁体   English

UIVisualEffectView在iOS 9.1中不起作用

[英]UIVisualEffectView not working in iOS 9.1

I've been consistently getting a grey background on my UIVisualEffectViews with blur enabled in iOS 9.1 我一直在UIVisualEffectViews上获得灰色背景,并在iOS 9.1中启用了模糊

If I enable vibrancy the view will just get a transparent background instead. 如果启用鲜艳度,则视图将只具有透明背景。 This can be reproduced both creating the views in code and in storyboard. 在代码和情节提要中创建视图都可以复制该视图。

I'm wondering if anyone else is experiencing this issue? 我想知道是否还有其他人遇到此问题? Same code works in iOS 9.0 and 8.x. 相同的代码可在iOS 9.0和8.x中使用。 This only happens in iPhone 6, but it works on iPhone 6 Plus and other devices. 这仅发生在iPhone 6中,但可以在iPhone 6 Plus和其他设备上使用。

May be related to UIVisualEffectView not working on iPhone 6 - Only difference is my code works on iOS 9.0- 可能与UIVisualEffectView不适用于iPhone 6-唯一的不同是我的代码可在iOS 9.0-

Nevermind. 没关系。 My fault. 我的错。

For anyone facing the same issue, the problem is that I had the option "Reduce Transparency" switched ON in my accessibility preferences (Under General->Accessibility->Increase Contrast) . 对于面临相同问题的任何人,问题在于我的可访问性首选项(在“常规”->“可访问性”->“增加对比度”下)“减少透明度”选项设置为

This was completely disabling the blur effect and thus making it grey. 这完全禁用了模糊效果,因此使其变成灰色。

you just need to change Effect from regular to Light 您只需要将效果从常规更改为光

on iOS 10.0 it will work fine but in iOS 9.0 instead of this pice of code () 在iOS 10.0上可以正常使用,但在iOS 9.0上可以代替此代码()

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleRegular];

use this(working fine with iOS 9.0): 使用此功能(与iOS 9.0兼容):

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle: UIBlurEffectStyleLight];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM