在iOS8以上的系统中,使用UIVisualEffectView添加毛玻璃效果时,无法设置它的alpha值,只能固定为1,如果设为小于1的值,会在Xcode控制台得到以下的warning:
<UIVisualEffectView 0x7fe2130553e0> is being asked
to animate its opacity. This will cause the effect to
appear broken until opacity returns to 1.
该警告容易在iOS 8系统中复现。其问题是系统在执行
alpha
渐变动画时,UIVisualEffectView
创建了裁剪区域外的模糊实例,警告说,他的效果可能会被破坏,然而经过测试没有被破坏。
但如果我们提供SDK给APP使用,在APP方的Xcode中总显示这么一条warning总不是一件好事:
这个warning是在运行时显示在控制台的,而不是编译、链接时产生的,还无法消除warning,比较坑爹。
搜了很多的解决办法,但也没有找到根本的方法:
http://stackoverflow.com/questions/26325141/xcode-warning-this-will-cause-the-effect-to-appear-broken-until-opacity-return