[英]Movieplayer navigation bar frame issue in iphone SDK
In my app, I recorded a video & play it through MpMovie Player. 在我的应用中,我录制了视频并通过MpMovie Player播放。 It seems works fine. 看起来不错。
But when i play video, The navigation bar(default progress bar) is come down rather than join with status bar. 但是,当我播放视频时,导航栏(默认进度栏)下降而不是与状态栏合并。
My code to play video is as follow 我播放视频的代码如下
-(IBAction)mth_play:(id)sender
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
NSString *VidLibrary = [paths objectAtIndex:0];
NSString *url = [VidLibrary stringByAppendingPathComponent:@"p.mp4"];
MPMoviePlayerViewController *pv=[[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL fileURLWithPath:url]];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(playfinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:[pv moviePlayer]];
MPMoviePlayerController *pc=[pv moviePlayer];
[self.view addSubview:pv.view];
[pc play];
}
How to solve this issue? 如何解决这个问题?
Is there any particular reason why you added the MPMoviePlayerViewController
's view
as a subview? 为什么将MPMoviePlayerViewController
的view
添加为子视图有任何特定的原因?
You can show the MPMoviePlayerViewController
modally instead: 您可以MPMoviePlayerViewController
模态显示MPMoviePlayerViewController
:
[self presentViewController:pv animated:YES completion:nil]; // iOS 5+
or 要么
[self presentModalViewController:pv animated:YES]; // technically deprecated in iOS 6
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.