Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set statusBar color on iPhoneX?

Tags:

iphone-x

I use the navigationController, and i hide the navigationBar, how to set statusBar color on iPhoneX? I do not want to set self.view.backgroundColor

iPhoneX notch color

enter image description here

like image 391
Jerny Avatar asked Dec 04 '17 03:12

Jerny


1 Answers

UIView *statusBar = (UIView *)[[UIApplication sharedApplication] valueForKey:@"statusBar"];
statusBar.backgroundColor = [UIColor greenColor];
like image 120
Jerny Avatar answered Sep 28 '22 15:09

Jerny