美文网首页iOS 开发
设置UINavgationBar的背景色

设置UINavgationBar的背景色

作者: 小码农_gjw | 来源:发表于2016-06-17 17:59 被阅读189次

全局设置导航栏背景色:

// 设置状态栏颜色

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;

// 设置全局UINavigationBar背景色

UINavigationBar*bar = [UINavigationBar  appearance];

CGFloat  rgb =0.1;

bar.barTintColor= [UIColor colorWithRed:rgb green:rgb blue:rgb alpha:0.9];

bar.tintColor= [UIColor whiteColor];

bar.titleTextAttributes=@{NSForegroundColorAttributeName: [UIColor whiteColor]};

相关文章

网友评论

    本文标题:设置UINavgationBar的背景色

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