美文网首页
全局设置导航栏

全局设置导航栏

作者: KermitX | 来源:发表于2016-09-06 15:57 被阅读53次
#ifdef __IPHONE_7_0 // iOS6 and later
#   define UITextAttributeFont    NSFontAttributeName
#   define UITextAttributeTextColor    NSForegroundColorAttributeName
#endif

    // APP风格设计
    [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
                                                           [UIColor whiteColor], UITextAttributeTextColor,
                                                           [UIFont boldSystemFontOfSize: 18.0f], UITextAttributeFont,
                                                           nil]];
    [[UINavigationBar appearance] setTintColor: [UIColor whiteColor]];
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setBackgroundColor: STYLIST_APP_COLOR];
    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
    [[UINavigationBar appearance] setBarStyle: UIBarStyleDefault];
    [[UINavigationBar appearance] setBarTintColor: STYLIST_APP_COLOR];
    
    if([UIDevice currentDevice].systemVersion.floatValue >= 8.0) {
        [[UINavigationBar appearance] setTranslucent:NO];
    }

      // 修好状态栏文字颜色
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];

相关文章

网友评论

      本文标题:全局设置导航栏

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