UINavigationBar的结构示意图以下所示:(ios7+)ios
不一样的app,对界面的设计风格都不同,只有精确了解UINavigationBar的结构图,才能很好的使用它api
//config for UINavigationBarapp
[[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"transparentBg"]函数
forBarPosition:UIBarPositionAnyspa
barMetrics:UIBarMetricsDefault];设计
//setShadowImage 须要和 setBackgroundImage 同时使用才生效it
[[UINavigationBar appearance] setShadowImage:[UIImage new]];io
//设置了BackgroundImage 就不要去设置BackgroundColor了ios7
// [[UINavigationBar appearance] setBackgroundColor:[UIColor navBackgroundColor]];方法
//也能够不用设置BarTintColor
// [[UINavigationBar appearance] setBarTintColor:[UIColor blackColor]];
[[UINavigationBar appearance] setBackIndicatorImage:[UIImage imageNamed:kNavButtonBackOnImage]];
[[UINavigationBar appearance] setBackIndicatorTransitionMaskImage:[UIImage imageNamed:kNavButtonBackImage]];
[[UINavigationBar appearance] setTitleTextAttributes:nil];
[[UINavigationBar appearance] setTintColor:[UIColor blueColor]];
具体函数的含义查看系统api方法
UITabBar的使用也是相似的