美团HD(1)-设置导航栏主题
自定义一个UINavigationController
DJNavigationController.h
#import <UIKit/UIKit.h> @interface DJNavigationController : UINavigationController @end
DJNavigationController.m
#import "DJNavigationController.h" @implementation DJNavigationController +(void)initialize { UINavigationBar *bar = [UINavigationBar appearance]; [bar setBackgroundImage:[UIImage imageNamed:@"bg_navigationBar_normal"] forBarMetrics:UIBarMetricsDefault]; } @end
最终效果: