【发布时间】:2013-03-12 21:41:13
【问题描述】:
我正在使用 UIAppearance 协议在整个应用程序中设置 UINavigationBar 对象的背景图像。
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"image-name"] forBarMetrics:UIBarMetricsDefault];
我想为 MFMailComposeViewController 的实例覆盖它,以便显示默认样式导航栏。我尝试使用 appearanceWhenContainedIn 进行设置,这适用于 iOS 5,但 not 在 iOS 6 上。
[[UINavigationBar appearanceWhenContainedIn:[MFMailComposeViewController class], nil] setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
是我犯了错误还是有更好的方法来完成这个?
【问题讨论】:
-
根据 Apple 开发人员支持:这是 iOS 7.0 中的一个已知错误。
-
这已在 iOS 9 中修复
标签: ios objective-c cocoa-touch ios6 uiappearance