gpt4 book ai didi

iphone - MPMoviePlayerViewController 方向

转载 作者:行者123 更新时间:2023-11-29 13:50:37 27 4
gpt4 key购买 nike

我正在使用 cocos2d,我想播放电影。为此,我创建了 MPMoviePlayerViewController 并将其作为 [[CCDirector sharedDirector] openGLView] 的 subview 。问题是它以垂直方向显示。

在应用中设置方向为横向:

[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];

如何更改播放器的方向?

最佳答案

看看cocos2d manual page关于autorotation的内容: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:autorotation

基本上,您必须在两种解决方案之间做出决定:

  1. Cocos2D 处理方向变化,您需要手动旋转 MPMoviePlayerViewController 的 View (例如使用 CGAffineTransformMakeRotation)。

  2. Cocos2D 的 opengl-view 不处理方向变化,它位于覆盖 shouldAutorotateToInterfaceOrientation 的 UIViewController 内,因此会自动为您旋转 View 。

关于iphone - MPMoviePlayerViewController 方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4808945/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com