如何在横向和纵向模式下仅制作MPMoviePlayerController [英] How to make only MPMoviePlayerController in both landscape and portrait mode
本文介绍了如何在横向和纵向模式下仅制作MPMoviePlayerController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个必须在单击某些缩略图时播放视频的应用程序,我正在显示列表.我只希望视频在横向和纵向模式下旋转,而其他屏幕则必须在纵向模式下旋转.
I am working on a application which has to play videos when clicking on some thumbnail, I am displaying list. I want only the Video to rotate in Landscape and Portrait Mode but other screens must in Portrait Mode How can we do this.
推荐答案
在ViewWillAppear中
In ViewWillAppear
UIViewController *vc = [[UIViewController alloc] init];
[self presentViewController:vc animated:NO completion:NULL];
[self dismissViewControllerAnimated:NO completion:NULL];
这将触发视图的重绘,并在您已实现这些功能的情况下调用以下功能
This will trigger the redrawing of the view and thus calling following functions, provided you have implemented these
- (BOOL)shouldAutorotate{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
这篇关于如何在横向和纵向模式下仅制作MPMoviePlayerController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文