Here you can see, that the status bar is above the black background. How to put status bar under it? Like you can see the navigation bar is.
I need to get something like this:
Here you can see, that the status bar is above the black background. How to put status bar under it? Like you can see the navigation bar is.
I need to get something like this:
this is possible if you create new window and add that view to it.
Make a window property in your ViewController as shown below
@property (nonatomic,strong) UIWindow *window;
And write below code in viewDidLoad
self.window =[[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor =[UIColor blueColor];
self.window.alpha =0.5;
UIView *view =[[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
view.backgroundColor =[UIColor greenColor];
[self.window addSubview:view];
self.window.hidden =NO;
self.window.windowLevel =UIWindowLevelStatusBar; // it works with window level as UIWindowLevelAlert
[self.window makeKeyAndVisible];
Hope this helps.
Try this code:
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
This will hide the status bar.
See the whole post here