iOS How to implement hidden navigation bar and status bar
The height of the status bar is 20 and the height of the navigation bar is 44. If the navigation bar of the status bar also exists, we usually set the X of the position of the control on the view to be greater than or equal to 64.
1: Hide navigation bar: = YES;
Two: Hide the status bar:
Step 1: Add two types (Type) to the file as bool options.Status bar is initially hidden Set to YES; View controller-based status bar appearance Set to NO;
Step 2: Write code on the page where you want to hide the status bar: [UIApplication sharedApplication].statusBarHidden = YES;
In addition, it is worth mentioning: The principle used for hiding the status bar and hiding the navigation bar is the same as the nature. If it is hidden in one page A, the status bar/navigation bar of other pages B (such as Apush to B) related to it will also be hidden. If you do not want to hide the status bar/navigation bar of a certain page, you can write it in viewWillAppear:(BOOL)animated[UIApplication sharedApplication].statusBarHidden = NO/ = NO;
Thank you for reading, I hope it can help you. Thank you for your support for this site!