开发者

Strange overlapping bug between navigation and status bars when rotating fullscreen videos in iPad

I'm implementing a video player inside my application and strange things happen when rotating the iPad when the video player is working in full screen.

My test case is kind of easy:

1.- I set orientation to Vertical

2.- I start video playing (non full screen)

3.- I set full screen

4.- I rotate the iPad while in fullscreen and set it to horizontal

5.- I go back to "non full screen"

6.- Navigation and status bar become overlapped overlapped in a very silly way. Look:

Strange overlapping bug between navigation and status bars when rotating fullscreen videos in iPad

7.- Then I rotate the iPad to Vertical again

Status and Navigation Bars don't overlap anymore. Look again:

Strange overlapping bug between navigation and status bars when rotating fullscreen videos in iPad

8.- Then I rotate back and forth to Horizontal and Vertical, and everything keeps being OK.

Hints?

I've read some other questions around, but no clear conclusion comes to my mind. There are some "official" fixes from apple (?) acknowledging some kind of bug, and trying to fix similar situations, like here: iPad rotation bug when using MPMoviePlayerViewCont开发者_Python百科roller

But even implementing that easy solution, the bug still appears for me. (I don't know if it's a bug, or it might even be a feature (?))

I'll be trying some more messing, but help will be more than welcome.

Greetings


unhiding status bar BEFORE replacing rootViewController works around this bug

[UIApplication sharedApplication].statusBarHidden=NO; self.window.rootViewController = whatever


It works perfectly

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieSmallScreen) name:MPMoviePlayerDidExitFullscreenNotification object:MPplayer];

-(void)MovieSmallScreen
{



UIView *view123 = [[UIView alloc] 
                   initWithFrame:[[UIScreen mainScreen] applicationFrame]];


self.view.frame=view123.frame;
}


You can try this code

- (void)viewWillAppear:(BOOL)animated
{
    [UIApplication sharedApplication].statusBarHidden=YES;

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜