Search code examples
iphonempmovieplayercontrollerfullscreenstatusbarnavbar

Going out of movie player fullscreen causes the navigationController's navigationBar to move behind status bar


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

I am using layoutSubviews to resize subviews during orientation changes.

When I play the movie in fullscreen, and, while still in fullscreen, rotate the phone, sometimes when I exit full screen, my navigation Bar "hides" halfway below the status bar, as if the origins for both are the same with the status bar on top.

I'm wondering if I'm doing something wrong... can anyone help?

Thanks!


Solution

  • For anyone looking for an answer, I fixed it by resetting the navigationController.navigationBar frame's origin to 0,20 as follows:

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