iPhone 以横向模式播放电影,但电影播放完毕后返回纵向模式
这里的 Total Objective-C/XCode N00b 但我正在尝试一些东西,我认为这很简单。我有一个为 iPhone 编写的应用程序,我不允许自动方向,只将主界面锁定为纵向。当用户在应用程序中播放视频时,我希望允许他们从纵向自动旋转设备并以横向观看(如果他们选择这样做,我不想强制这样做)。一旦用户按下“完成”,我想强制他们回到纵向(即使他们将设备横向握住),因为界面仅以该方向布局。
我尝试过使用 MPMoviePlayerController 和 MPMoviePlayerViewController,但我不确定哪个能给我所需的杠杆/方法。我基本上只是希望仅当 MPMoviePlayerController 视图可见时才允许 shouldAutorotateToInterfaceOrientation 返回 yes 。
非常感谢任何帮助。谢谢。
Total Objective-C/XCode N00b here but I am attempting something, which I assume is simple. I have an app that is written for the iPhone, I don't allow auto orientation and only have the main interface locked into portrait. When the user plays a video in the app I would like to allow them to auto rotate the device from portrait and watch it in landscape (should they choose to do so, I don't want to force this). Once the user presses "Done", I would like to force them back into portrait (even if they are holding the device in landscape) as the interface is only laid out in that orientation.
I've tried using the MPMoviePlayerController and MPMoviePlayerViewController and I am not sure which will give me the leverage/methods I need. I am basically just looking to allow shouldAutorotateToInterfaceOrientation to return yes only when the MPMoviePlayerController view is visible.
Any help MUCH appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我用了 此代码示例e并且运行良好。我认为你必须在超级类中设置方向。
I used this code example and it worked perfectly. I think you'll have to set the orientation in the super class.