【发布时间】:2014-11-13 11:34:17
【问题描述】:
我的应用程序的方向有问题。应用程序仅支持纵向模式,但它使用 MPMoviePlayerViewController 播放一些视频,允许用户以横向模式查看视频。
为此,我在 AppDelegate.m 中使用了以下代码:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
UINavigationController* ns = (UINavigationController*) window.rootViewController;
if (ns && [ns respondsToSelector:@selector(visibleViewController)]) {
UIViewController* vc = [ns visibleViewController];
if ([vc isKindOfClass:[MPMoviePlayerViewController class]]) {
return UIInterfaceOrientationMaskAll;
}
}
return UIInterfaceOrientationMaskPortrait;
}
此代码在 iOS7 中运行良好,但在 iOS8 中视频完成后,下一个视图控制器以横向模式打开。 谁能帮我解决这个问题?
【问题讨论】:
标签: video ios8 orientation mpmovieplayercontroller