我有一个视图和一个MPMoviePlayerViewController .. iPad是面向横向左模式,但是当我播放视频时,视频很好看在纵向模式... 有没有一种方法强制movieplayer在横向模式下旋转? 由于事先MPMoviePlayerViewController在iPad视图风景
1
A
回答
3
可以强制MPMoviePlayerViewcontroller通过
[player setOrientation:UIDeviceOrientationPortrait animated:NO];
在landscapce模式下工作,可以阅读示例代码我的博客文章http://www.makebetterthings.com/blogs/iphone/play-video-on-iphone-and-ipad/
4
@interface MyMovieViewController : MPMoviePlayerViewController
@end
@implementation MyMovieViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return UIInterfaceOrientationIsLandscape(toInterfaceOrientation);
}
@end
然后只需实例MyMovieViewController代替MPMoviePlayerViewController 。
相关问题
- 1. iPad风景+肖像视图
- 2. iPad启动图像风景
- 3. potrait中的滚动视图和ipad中的风景
- 4. iPad风景模态视图大小不正确
- 5. 风景视图源代码?
- 6. 风景iPad在肖像中显示视图,然后快速将其旋转至风景
- 7. NYTimes iPad应用风格网格视图
- 8. HTML5 vimeo视频没有在ipad上播放风景
- 9. iPad始终在风景中开始
- 10. MPMoviePlayerViewController iPad内存泄漏
- 11. 调用MPMoviePlayerViewController done按钮。 iPad
- 12. Topbar无法在风景视图中以横向视图旋转
- 13. 创建视图叠加在MPMoviePlayerViewController
- 14. 问题:用MPMoviePlayerViewController在iPad上播放视频
- 15. 在iPad模拟器中测试MPMoviePlayerViewController
- 16. iOS在全屏幕(iPad)中使用MPMoviePlayerViewController
- 17. 在SDK 3.2中使用MPMoviePlayerViewController for iPad
- 18. 如果addsubview是在风景中完成,那么视图不是风景? iPhone SDK
- 19. UINavigationBar根视图不旋转到风景
- 20. 旋转到风景的视图 - iOS
- 21. 项目中的风景视图Eclipse
- 22. 风景取向,半视图。 Swift
- 23. MPMoviePlayerViewController完成应用程序返回风景
- 24. iPad风景无法正确调整子视图的正确尺寸
- 25. iPad Apps的风景和人像取向
- 26. iPad风景模式下的iAd布局
- 27. 仅iPad风景(左侧或右侧)
- 28. 适用于iPad的风景方向?
- 29. 在MPMoviePlayerViewController中恢复视频
- 30. MPMoviePlayerViewController退出后背景
谢谢Saurabh! 我昨天读了你的博客(我也打了电话),但是在哪里显示我跳过的东西,我不知道怎么回事!!!!! 谢谢,我会尽快尝试! – ghiboz 2010-06-08 10:21:30
对不起,但MPMMoviePlayerViewController没有setOrientation方法... https://developer.apple.com/iphone/prerelease/library/documentation/MediaPlayer/Reference/MPMoviePlayerViewController_class/Reference/Reference.html – ghiboz 2010-06-08 20:11:01
对不起,我阅读进入你的博客setOrientation尚未准备好用于iPad ...... – ghiboz 2010-06-08 20:14:27