self.navigationController.navigationBar.translucent=NO;
默认为yes
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
[[UINavigationBar appearance]setTintColor:NavigationColor];
} else {
[[UINavigationBar appearance]setTintColor:[UIColor whiteColor]]; // it set color of bar button item text
[[UINavigationBar appearance]setBarTintColor:[UIColor GreenColor]]; // it set color of navigation
[[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; // it set Style of UINavigationBar
[[UINavigationBar appearance]setTitleTextAttributes:@{UITextAttributeTextColor : [UIColor whiteColor]}]; //It set title color of Navigation Bar
}
iOS导航栏颜色设置
本文介绍了如何在iOS应用中设置UINavigationBar的颜色属性,包括按钮文字颜色、背景颜色及样式等,并提供了针对不同iOS版本的适配代码。
1007

被折叠的 条评论
为什么被折叠?



