iOS-UINavigationBar【颜色设置】


UINavigationBar的一些颜色设置,以前老是忘,这次记住了

- (void)setNavigationBar{
    ///NavigationBar backgroundcolor【背景色】
    [[UINavigationBar appearance] setBarTintColor:Wonderful_GreenColor9];
    ///left、right-item color【左右item的颜色】
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    ///title颜色 Attributes 可以包含字体颜色和大小以及字体样式【中间Title字体】
    [UINavigationBar appearance].titleTextAttributes = @{NSForegroundColorAttributeName :[UIColor whiteColor]};
    
    ///navigation背景图
//    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
//    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
//    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"topbg"] forBarMetrics:UIBarMetricsDefault];
//    [UINavigationBar appearance].translucent = NO;
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM