将 MPMoviePlayerController 旋转为横向 - iPhone SDK
我试图将 MPMoviePlayerController 旋转到横向视图,但它始终保持纵向模式。我在 UIViewController 中执行此操作,当我处于全屏模式时,我仍然无法旋转 MPMoviePlayerController。我必须对 shouldAutorotatetoOrientation 方法做些什么吗?如果有人知道如何做到这一点,请回复!
谢谢,
凯文
I am trying to rotate my MPMoviePlayerController to landscape view, but it always stays in portrait mode. I am doing this in a UIViewController and I still can't rotate my MPMoviePlayerController when I am in full screen mode. Do I have to do something to the shouldAutorotatetoOrientation method? If anyone knows how to do this please leave a reply back!!
Thanks,
Kevin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 UIViewController 类参考:
例如,如果您的 autoresizingMask 设置为 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight,并且电影播放器视图的父视图具有
autoresizesSubviews = YES
,那么从shouldAutorotateToInterfaceOrientation
返回 YES 可能就是您需要做的全部事情。From the UIViewController class reference:
For example, if your
autoresizingMask
is set toUIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight
, and the parent view of your movie player view hasautoresizesSubviews = YES
, then returning YES from theshouldAutorotateToInterfaceOrientation
may be all you need to do.我发现这种方法很有用,但设置所需的框架很花时间-
i found this way only useful but it is timetaking to set the desired frame-