iOS-UINavigationBar【颜色设置】

时间:2017-12-04 11:28:24   收藏:0   阅读:272

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;
}

 

原文:http://www.cnblogs.com/wangkejia/p/7976043.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!