我正在播放嵌入在 WebView 中的 youtube 中的一些视频,我需要视频播放器水平或垂直旋转,但我无法做到。我特别需要旋转视频播放器,而不是 View ,因为该应用程序在纵向模式下工作。任何帮助将不胜感激。
最佳答案
在您的 plist 文件中,您应该检查您的应用程序将支持的所有方向。 这意味着,您也应该检查横向左侧和横向右侧。
对于每个你不想旋转的ViewController,你需要实现这些方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait)
}
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
像这样。
关于ios - 在 iOS 7 中将视频播放器旋转到横向模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25214809/