状态栏重叠导航栏:MPMoviePlayerController
Status bar overlaps Navigation Bar : MPMoviePlayerController
我正在使用 MPMovieplayer
作为子视图一切正常,但我的问题是当我单击全屏视频然后返回到小视频帧然后状态栏与导航栏重叠
这是我的代码
// Setup player
MPMoviePlayerController* mp =
[[MPMoviePlayerController alloc] initWithContentURL:videoURL];
mpc = mp;
mpc.shouldAutoplay = YES;
[mpc prepareToPlay];
mpc.view.frame = CGRectMake(0, 0, 320, 320);
mpc.backgroundView.backgroundColor = [UIColor redColor];
[self.view addSubview:mpc.view];
/* Create a new movie player object. */
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (player)
{
/* Save the movie object. */
[self setMoviePlrController:player];
/* Register the current object as an observer for the movie
notifications. */
[self installMovieNotificationObservers];
/* Specify the URL that points to the movie file. */
[player setContentURL:movieURL];
/* If you specify the movie type before playing the movie it can result
in faster load times. */
[player setMovieSourceType:sourceType];
[player setRepeatMode:MPMovieRepeatModeNone];
player.scalingMode = MPMovieScalingModeAspectFit;
// Apply the user movie preference settings to the movie player
[self.moviePlrController.view setAutoresizingMask:(UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth)];
[self.playerView addSubview:[self moviePlrController].view];
CGRect frame = self.playerView.frame;
int width = frame.size.width;
int height = frame.size.height;
[[self moviePlrController].view setFrame:CGRectMake(0, 0, width, height)];
}
我已经通过在 .plist 文件中添加密钥解决了问题
'View controller-based status bar appearance' and set to NO.
然后设置隐藏状态栏为NO
我正在使用 MPMovieplayer
作为子视图一切正常,但我的问题是当我单击全屏视频然后返回到小视频帧然后状态栏与导航栏重叠
这是我的代码
// Setup player
MPMoviePlayerController* mp =
[[MPMoviePlayerController alloc] initWithContentURL:videoURL];
mpc = mp;
mpc.shouldAutoplay = YES;
[mpc prepareToPlay];
mpc.view.frame = CGRectMake(0, 0, 320, 320);
mpc.backgroundView.backgroundColor = [UIColor redColor];
[self.view addSubview:mpc.view];
/* Create a new movie player object. */
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (player)
{
/* Save the movie object. */
[self setMoviePlrController:player];
/* Register the current object as an observer for the movie
notifications. */
[self installMovieNotificationObservers];
/* Specify the URL that points to the movie file. */
[player setContentURL:movieURL];
/* If you specify the movie type before playing the movie it can result
in faster load times. */
[player setMovieSourceType:sourceType];
[player setRepeatMode:MPMovieRepeatModeNone];
player.scalingMode = MPMovieScalingModeAspectFit;
// Apply the user movie preference settings to the movie player
[self.moviePlrController.view setAutoresizingMask:(UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth)];
[self.playerView addSubview:[self moviePlrController].view];
CGRect frame = self.playerView.frame;
int width = frame.size.width;
int height = frame.size.height;
[[self moviePlrController].view setFrame:CGRectMake(0, 0, width, height)];
}
我已经通过在 .plist 文件中添加密钥解决了问题
'View controller-based status bar appearance' and set to NO.
然后设置隐藏状态栏为NO