我有以下的代码片段:如何在Xcode中定制iPhone上的导航栏?
1)
[[UINavigationBar appearance] setBackgroundImage:myImage forBarMetrics:UIBarMetricsDefault];
会在哪里我把那?
或2)
@implementation UINavigationBar (BackgroundImage)
//This overridden implementation will patch up the NavBar with a custom Image instead of the title
- (void)drawRect:(CGRect)rect {
UIImage *image = [UIImage imageNamed: @"NavigationBar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
}
@end
会在哪里我把那?
我曾尝试添加一个导航栏到我的viewcontroller,但我不完全知道在哪里把这些代码段。
你也可以问你会需要定制,为改变说整个导航彩色/酒吧/ titleImage ...等 – Splendid 2012-01-07 16:43:02
问题看起来像重复,你可以参考下面的线程 - http://stackoverflow.com/questions/704558/custom-uinavigationbar-background – rishi 2012-01-07 16:55:14