【发布时间】:2011-12-22 08:18:07
【问题描述】:
在我的 AppDelegate 中,我使用外观代理来制作自定义 UI:
//Setup custom appearances
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"header"] forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setTintColor:[UIColor blackColor]];
[[UIToolbar appearance] setBackgroundImage:[UIImage imageNamed:@"header"] forToolbarPosition:UIToolbarPositionAny barMetrics:UIBarMetricsDefault];
这将在 iOS4 中崩溃。如何检查该功能在他们运行的 iOS 版本上是否可用,从而避免崩溃?
【问题讨论】:
-
Check iPhone iOS Version 的可能重复项
标签: iphone objective-c cocoa-touch uinavigationbar appearance