gpt4 book ai didi

ios - 检测设备是否正确显示 UIVisualEffectView?

转载 作者:技术小花猫 更新时间:2023-10-29 10:25:51 27 4
gpt4 key购买 nike

我的应用使用 UIVisualEffectView 来模糊背景,就像控制中心一样。但我发现可以运行 iOS 8 的 iPad 2(和 Retina iPad)不够强大,无法显示这种效果,因此它会恢复为灰色。我希望能够检测应用程序运行的设备是否足够强大以显示模糊效果,如果不是,我不会应用它,而是将背景颜色更改为看起来比那种灰色。但我不想只检查设备是 iPad 2 还是 iPad 3rd gen(它也影响 4th 吗?)。是否有更好的方法来检测 UIBlurEffect 是否会按预期显示?

最佳答案

查看此 WWDC session :http://asciiwwdc.com/2014/sessions/419

So, and to reiterate on what devices we don't blur and that we only do the tinting on the iPad 2 and iPad 3rd generation, we just apply the tint and we skip the blur steps.

[...]

On iPad 4th generation, iPad Air, iPad Mini, iPad Mini with retina display, iPhones and the iPod touch we do both the blur and the tinting.

我猜你必须求助于检查机器名称:

#import <sys/utsname.h>
...

struct utsname systemInfo;
uname(&systemInfo);

NSString *deviceName = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
...

关于ios - 检测设备是否正确显示 UIVisualEffectView?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26411227/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com