gpt4 book ai didi

iOS 10 Blur Effects Prominent and Regular 不工作

转载 作者:搜寻专家 更新时间:2023-10-30 22:05:26 27 4
gpt4 key购买 nike

我没有在网上找到任何相关问题,我正在尝试获取模糊 View 以显示新的模糊效果 .prominent 和 .regular 但它们没有显示。当我将模糊效果更改为 .light、.extraLight 或 .dark 时,效果很好。它在描述中说新的模糊效果适应用户界面。这是什么意思,为什么这两个新的模糊效果不起作用?

我在模拟器和我的 iPhone 中都有 iOS 10,但它们都没有显示新的模糊效果。打印语句表示正在调用 if 语句(而不是 else),正如预期的那样。

let blurEffect : UIBlurEffect!
if #available(iOS 10.0, *) {
blurEffect = UIBlurEffect(style: .prominent )
} else {
// Fallback on earlier versions
blurEffect = UIBlurEffect(style: .light )
}
let blurView = UIVisualEffectView(effect: blurEffect)
blurView.frame = CGRect(x: 100, y: 100, width: 200, height: 300)

最佳答案

What does that mean, and why aren't those two new blur effects working?

摘自 WWDC 2016 session 206:tvOS 的新功能:

We've also added two new blur styles to the API.
You can now use UIBlurEffectStyleRegular or UIBlurEffectStyleProminent.
And we call these automatic styles.
And they'll actually adjust the effective blur effect style based on what the system setting is.
So if you use UIBlurEffectStyleRegular and the system's in light, it will use UIBlurEffectStyle.light.
If you use regular and dark, you'll use dark.
If you use prominent, it will use .extraLight and .extraDark.
.extraDark will be coming in a later seed

查看 session 的所有文本:http://asciiwwdc.com/2016/sessions/206

基本上,此效果适用于 tvOS。该操作系统可以采用深色或浅色风格。对于 iOS,这些效果在灯光模式下有效。

关于iOS 10 Blur Effects Prominent and Regular 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40564408/

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