I want to hide staus bar in single view controller but my code is not working. I'm using the below code
-(BOOL)prefersStatusBarHidden
{
return YES;
}
&
-(void)viewWillApper:(BOOL)animated{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
-(void)viewWillDisappear:(BOOL)animated{
[[UIApplication sharedApplication] setStatusBarHidden:NO];
}
You should add this value to plist: "View controller-based status bar appearance" and set it to "NO".
or
in
or
Add following line in viewdidload
and add new method
try this one it's help for me-:
if you have
View controller-based status bar appearance
set toYES
in app'splist
, put this code in the view controller:and if
View controller-based status bar appearance
is set toNO
, do the following whenever you want to hide the status bar.To hide status bar on a single VC:
1) Add this value to plist:
"View controller-based status bar appearance" and set it to "YES"
2) Add following to viewWillAppear:
3) Add new method: