gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-30 19:40:46 24 4
gpt4 key购买 nike

我正在尝试将我的 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/

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