UIVisualEffectView在不同设备上的呈现方式不同 [英] UIVisualEffectView renders differently on different devices

查看:326
本文介绍了UIVisualEffectView在不同设备上的呈现方式不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 ViewController.swift 中:

var img = UIImageView(image: UIImage(named: "puddles"))

img.frame = view.bounds;
view.addSubview(img);


var effect = UIBlurEffect(style: UIBlurEffectStyle.Light)
var effectView = UIVisualEffectView(effect: effect)
effectView.frame = CGRectMake(0, 0, 500, 500)
view.addSubview(effectView)

使用代码渲染的图像以上 iPad Air iPhone 5 iPhone 5S 模拟器:

The image as rendered using the code above in the iPad Air, iPhone 5, or iPhone 5S simulators:

使用上面代码在 iPhone 4S 中呈现的图像, iPad 2 iPad Retina 模拟器:

The image as rendered using the code above in the iPhone 4S, iPad 2, or iPad Retina simulators:

注意:以上两张图片从模拟器中取出,但这也可以在运行iOS 8 Beta 1的实际设备上重现。

显然,我想实现第一个对所有设备的影响。如何在所有设备上实现相同的第一个效果?

Obviously, I would like to achieve the first effect on all devices. How can I achieve the same first effect on all devices?

推荐答案

UIVisualEffectView 在iOS 8中,与iOS 7中的(以前的私有API)半透明和活力效果几乎完全相同。就像iOS 7效果一样,它们回归到图形上更简单的硬件实现,无法呈现如此复杂的图形效果实时。

UIVisualEffectView in iOS 8 does pretty much the same thing as the (formerly private API) translucency and vibrancy effects seen in iOS 7. Like the iOS 7 effects, they fall back to graphically simpler implementations on hardware that can't render such complex graphics effects in realtime.

这篇关于UIVisualEffectView在不同设备上的呈现方式不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆