【发布时间】:2012-09-15 19:12:51
【问题描述】:
我正在使用此代码在整个应用中自定义导航栏图像。
UIImage *navBarTexture = [[UIImage imageNamed:@"NavBarTexture_iPad"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UINavigationBar appearance] setBackgroundImage:navBarTexture forBarMetrics:UIBarMetricsDefault];
[[UINavigationBar appearance] setBackgroundImage:navBarTexture forBarMetrics:UIBarMetricsLandscapePhone];
这很神奇。但是,当在 UIPopoverControllers 的导航栏上使用这个图像时,它看起来有点奇怪。我要使用它的默认 Apple 图像,我怎样才能让它保持原来的外观?
我知道我可以使用appearanceWhenContainedIn: 但是如果我将 nil 作为图像返回,我只会得到一个黑色空间。
【问题讨论】:
标签: objective-c ipad uinavigationbar appearance