【发布时间】:2014-09-22 06:51:24
【问题描述】:
我正在尝试使用UIBlurEffect 和UIVibrancyEffect 进行查看。
Apple docs here 声称“notificationCenterVibrancyEffect”,但即使在我的课程中导入 UIKit 后,它也会抛出 No known class method for selector notificationCenterVibrancyEffect。
代码看起来像这样,其他所有类方法都可以正常解析:
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect notificationCenterVibrancyEffect];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
UIVisualEffectView *vibrancyEffectView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
【问题讨论】:
-
您使用的是什么版本的 iOS?这被记录在“iOS 8.0 或更高版本”中。
-
抱歉,这很清楚 - 是的,所有目标都设置为 iOS 8
-
你在和 Swift 交互吗?文档只显示了 Obj-C 可用的方法,这很奇怪。
-
不,不是 Swift——真正奇怪的是我看到有人在 Swift 中使用它写了一个要点:-/
标签: objective-c ios8 uiblureffect