ios statusbar背景透明能看到下层view的数据
如题
ios8.2
用一个navigationController包住一个tableViewController
然后设置了navbar背景
- (void)viewDidLoad {
[super viewDidLoad];
//navbar背景
UINavigationBar *navBar = [UINavigationBar appearance];
[navBar setBackgroundColor:MCOLOR(COLOR_GLOBAL_B2)];
//去除边框
[self.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
[self.navigationBar setShadowImage:[[UIImage alloc] init]];
//title样式
[self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:20], NSFontAttributeName, MCOLOR(@"gray"), NSForegroundColorAttributeName, nil]];
}
显示的效果如下
求解决!
uinavigationcontroller ios uinavigationbar
但愿有天堂
9 years, 5 months ago
Answers
- (void)viewDidLoad {
[super viewDidLoad];
//navbar背景
UINavigationBar *navBar = [UINavigationBar appearance]; //删除
[navBar setBackgroundColor:MCOLOR(COLOR_GLOBAL_B2)]; //删除
//去除边框
[self.navigationBar setBackgroundImage:[[UIImage alloc] init] // 删除 forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
[self.navigationBar setShadowImage:[[UIImage alloc] init]];
//title样式
[self.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:20], NSFontAttributeName, MCOLOR(@"gray"), NSForegroundColorAttributeName, nil]];
//添加这一行
[self.navigationBar setBarTintColor:MCOLOR(COLOR_GLOBAL_B2)];
}
河蟹你内流满面
answered 9 years, 5 months ago