Do not resize the navigation bar when hiding the status bar.

I create an application using Swift + AVPlayer and set "View controller-based status bar" to "YES". The problem is that when I launch the player from my UITableViewController / UINavigationController, the navigation bar automatically hides the status bar and the navigation bar changes.

You can see what I mean here:

http://quick.as/eOXLiv45x

enter image description here

Is there any way to prevent this?

Hooray!

+6
source share
2 answers

Ok, so this is the solution I used at the end.

  • Set "View controller-based control panel status" to "NO"
  • Cancel the following functions in the media view controller.
override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) UIApplication.sharedApplication().setStatusBarHidden(true, withAnimation: .Fade) } override func viewWillDisappear(animated: Bool) { super.viewWillDisappear(animated) UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: .Fade) } 
+1
source
 - (BOOL)hidesBottomBarWhenPushed { return YES; } 

You can try this. But I'm 90% sure that this problem should be related to some actions that you perform ... If you want to prevent this, read this function and disable the hide function, or perhaps create another method to execute after inform functions keep visibility.

-1
source

Source: https://habr.com/ru/post/987815/


All Articles