iOS 10 模糊效果突出和正常不工作
iOS 10 Blur Effects Prominent and Regular not working
我没有在网上找到任何相关问题,我正在尝试获取模糊视图以显示新的模糊效果 .prominent 和 .regular 但它们没有显示。当我将模糊效果更改为 .light、.extraLight or.dark 时,效果很好。它在描述中说新的模糊效果适应用户界面。这是什么意思,为什么这两个新的模糊效果不起作用?
我在模拟器和我的 iPhone 中都有 iOS 10 个,其中 none 个正在显示新的模糊效果。打印语句表示正在调用 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:电视中的新功能OS :
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
基本上这个效果是针对电视的OS。 OS 可以是深色或浅色。 iOS 这些效果在灯光模式下有效。
我没有在网上找到任何相关问题,我正在尝试获取模糊视图以显示新的模糊效果 .prominent 和 .regular 但它们没有显示。当我将模糊效果更改为 .light、.extraLight or.dark 时,效果很好。它在描述中说新的模糊效果适应用户界面。这是什么意思,为什么这两个新的模糊效果不起作用?
我在模拟器和我的 iPhone 中都有 iOS 10 个,其中 none 个正在显示新的模糊效果。打印语句表示正在调用 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:电视中的新功能OS :
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
基本上这个效果是针对电视的OS。 OS 可以是深色或浅色。 iOS 这些效果在灯光模式下有效。