设置statusBar,navigationBar,tabBar

作者: ForeverYoung21 | 来源:发表于2015-01-02 19:44 被阅读430次

    设置statusBar,navigationBar,tabBar的颜色

    //AppDelegate.m
    //设置navigationBarColor
    
    [[UINavigationBar appearance] setTranslucent:YES];
    [[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:128/255.0f green:128/255.0f blue:128/255.0f alpha:1.0]];
    
    
    // 设置tabBarColor
    [[UITabBar appearance] setTranslucent:NO];
    [[UITabBar appearance] setBarTintColor:[UIColor colorWithRed:128/255.0f green:128/255.0f blue:128/255.0f alpha:1.0]];
    
    // 设置status文字颜色
    
    [[UIApplication sharedApplication] setStatusBarHidden:NO];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    

    此外,需要在.plist文件增加一行:

    View controller-based status bar appearance = NO

    表示viewController不对status bar进行操作。

    相关文章

      网友评论

      • a02efb1fb47a:挺好的,还这么多粉丝,,我给你来个评论,,,都是同行的

      本文标题:设置statusBar,navigationBar,tabBar

      本文链接:https://www.haomeiwen.com/subject/gmvztttx.html