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