[英]How to change the color of the status bar?
我有一个简单的问题要问你。 是否可以在iOS 7(如Facebook应用程序)中更改状态栏的颜色,并且还可以增加状态栏的透明度?
戴维,谢谢你
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0)?YES:NO) {
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"newImage.png"] forBarMetrics:UIBarMetricsDefault];
}else{
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"previousImage.png"] forBarMetrics:UIBarMetricsDefault];
}
或者,您也可以这样做:
[UINavigationBar appearance].barTintColor = [UIColor redColor];
如果您没有在应用程序中显示导航栏。
您可以更改导航栏颜色以更改状态栏颜色。
[UINavigationBar appearance].barTintColor = [UIColor greenColor];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.