ios 设置状态栏背景颜色
2014-10-10 16:25
393 查看
第一种方法:
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
if (is_ios_7_Later) {
self.view.window.frame = CGRectMake(0, 20,
self.view.window.frame.size.width, self.view.window.frame.size.height - 20);
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
}
第二种方法(这方法比较简单):
UIView *statusBarView=[[UIView
alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
statusBarView.backgroundColor=[UIColor
blackColor];
[self.view
addSubview:statusBarView];
[[UIApplication
sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent
animated:NO];
[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
if (is_ios_7_Later) {
self.view.window.frame = CGRectMake(0, 20,
self.view.window.frame.size.width, self.view.window.frame.size.height - 20);
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
}
第二种方法(这方法比较简单):
UIView *statusBarView=[[UIView
alloc] initWithFrame:CGRectMake(0, 0, 320, 20)];
statusBarView.backgroundColor=[UIColor
blackColor];
[self.view
addSubview:statusBarView];
[[UIApplication
sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent
animated:NO];
相关文章推荐
- iOS 设置状态栏的背景颜色
- ios 设置状态栏背景颜色
- iOS平台设置系统状态栏(通知栏、顶部状态栏)样式背景颜色或透明
- ios状态栏颜色的设置(背景、前景)
- iOS 设置状态栏的背景颜色方法
- iOS如何把所有界面的状态栏的字体颜色都设置为白色
- ios tableview和cell背景颜色设置
- iOS用图片设置背景颜色colorWithPatternImage
- iOS开发 设置整个导航栏背景图、字体及标签栏更改选中背景图的颜色
- iOS 设置状态栏的颜色
- IOS 实现自定义的导航栏背景以及自定义颜色的状态栏(支持7.0以及低版本)
- 简单记录,设置一体化状态栏背景颜色的方法
- iOS开发UITabBar背景、icon图标颜色、被选中背景设置以及隐藏UITabBar的两种方式
- Arcgis ios skd 中 设置背景颜色 和方格 的颜色
- 设置状态栏、导航栏背景颜色,修改导航栏返回按钮颜色
- (二)iOS如何把所有界面的状态栏的字体颜色都设置为白色
- iOS 7 UITableview 在Plain模式下 设置背景颜色无效
- ios自定义导航navigation,设置navigation的背景图,navigation左边按钮,以及navigation字体颜色
- ios设置导航栏背景图片、返回按钮背景、标题颜色等等
- iOS开发之iOS7设置状态栏字体颜色