私はのdrawRectをオーバーライドすることでUINavigationController
のbackgroung画像を変更することができるよ:メソッド:UINavigationControllerの背景色を変更するには?
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIImage *img = [UIImage imageNamed: @"navController.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = [UIColor blueColor];
}
@end
背景には、私はあることを意図したものであるとtintColor
だけでなく、しかし「にISN色を設定しようとしたとき私は私が欲しい色を表示するUINavigationBar
を強制するにはどうすればよい
@implementation UINavigationBar (UINavigationBarCategory)
- (void)drawRect:(CGRect)rect {
UIImage *img = [UIImage imageNamed: @"navController.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = [UIColor colorWithRed:(26/255) green:(103/255) blue:(159/255) alpha:1];
}
@end
:トンUIColor
クラス内の既存のそれは奇妙な色を失敗して示して?
注:バックグラウンド自体が画像に設定されているため、ナビゲーションコントローラのボタンの色に問題があります。
作品のための作品!ありがとう – 4mahmoud