当您的申请收到如下所示的方向更改呼叫时,您可以检查课程。
#pragma mark - Orientations Methods
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
if ([[self.window.rootViewController presentedViewController] isKindOfClass:[MPMoviePlayerViewController class]])
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
else
{
if ([[self.window.rootViewController presentedViewController] isKindOfClass:[UINavigationController class]])
{
// look for it inside UINavigationController
UINavigationController *nc = (UINavigationController *)[self.window.rootViewController presentedViewController];
// is at the top?
if ([nc.topViewController isKindOfClass:[MPMoviePlayerViewController class]])
{
return UIInterfaceOrientationMaskAllButUpsideDown;
// or it's presented from the top?
}
else if ([[nc.topViewController presentedViewController] isKindOfClass:[MPMoviePlayerViewController class]])
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
}
}
return UIInterfaceOrientationMaskPortrait;
}
这种方法将检查,如果你的课是电影播放器,那么它将允许旋转你的视图。你需要处理当用户按下完成按钮在电影播放器
http://stackoverflow.com/questions/24928057/only-one-view-landscape-mode –