我知道這個問題看起來和其他人一樣,但他們都沒有提到ios4和ios5之間的不兼容問題。ios4中的導航欄自定義在ios5中不起作用
在我的應用我想自定義導航欄的格局,但我的部署目標是iOS4的,所以我使用的代碼波紋管的appDelegate.m實施上述要做到這一點:
@implementation UINavigationBar (CustomImage)
- (void)drawRect:(CGRect)rect {
UIColor *color = [UIColor blackColor];
UIImage *image = [UIImage imageNamed: @"nav_bar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = color;
}
@end
當我運行應用程序使用4.3模擬器,它工作正常,但是當我在ios5中模擬,它不工作,導航欄回到默認顏色..任何幫助?
謝謝。