Exiting full-screen movie mode causes navigationController navigationBar to move beyond the status bar

I have an MPMoviePlayerController view added as a subview on my ViewController.

I use layoutSubviews to resize the view during orientation changes.

When I play a movie in full screen mode and while still in full screen mode, rotate the phone, sometimes when I exit full screen mode my navigation bar “hides” halfway below the status bar, as if the origin for both was the same with the line state from above.

I am wondering if I am doing something wrong ... can anyone help?

Thank!

+3
source share
3

, , , frameSontroller.navigationBar 0,20 :

self.navigationController.navigationBar.frame = CGRectMake(0, 20, self.navigationController.navigationBar.frame.size.width, self.navigationController.navigationBar.frame.size.height);
+3

, , Apple:

, . , , . UINavigationBar, , initWithNavigationBarClass: toolbarClass: . , navigationBarHidden setNavigationBarHidden: :

https://developer.apple.com/library/ios/documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html

, :
1) "" .

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playerChangedState) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil];

2) :

// run this method on the main thread
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
    [self.navigationController setNavigationBarHidden:YES];
    [self.navigationController setNavigationBarHidden:NO animated:YES];

. iOS 7, iOS.

+5

, - : MPMoviePlayerController

Basically, I had to add a delayed call to set [UIApplication sharedApplication] .statusBarHidden = NO;

(published here, just someone else has this problem)

+2
source

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


All Articles