iphone - 将 MPMoviePlayerController 旋转为横向 - iPhone SDK

标签 iphone objective-c mpmovieplayercontroller rotation landscape

我正在尝试将我的 MPMoviePlayerController 旋转到横向 View ,但它始终保持纵向模式。我在 UIViewController 中执行此操作,当我处于全屏模式时,我仍然无法旋转我的 MPMoviePlayerController。我必须对 shouldAutorotatetoOrientation 方法做些什么吗?如果有人知道如何做到这一点,请留下回复!!

谢谢,

凯文

最佳答案

来自UIViewController class reference :

By default, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation: method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed.

例如,如果您的 autoresizingMask设置为 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ,你的电影播放器​​ View 的父 View 有 autoresizesSubviews = YES ,然后从 shouldAutorotateToInterfaceOrientation 返回 YES可能就是您需要做的一切。

关于iphone - 将 MPMoviePlayerController 旋转为横向 - iPhone SDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3697387/

相关文章:

iphone - Objective-C 字符串格式化

ios - 如何在后台任务中的 AVQueuePlayer 中的 AVPlayerItems 之间进行延迟?

ios - 使用 MPMoviePlayerViewController 的时髦错误

ios - MPMoviePlayerController 的警告

objective-c - MPMoviePlayerViewController 没有在第二次运行时播放

iphone - 如何删除 UISearchBar 中的工具提示

iphone - (iPhone)保存dsym或任何其他文件以查看崩溃日志?

iphone - 如何在 iPhone 应用程序中管理模型和 View ?

支持服务器的 iOS 9 ATS SSL 错误

iphone - 调整 MPMediaPickerController View 的大小?