當您的申請收到如下所示的方向更改呼叫時,您可以檢查課程。
#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 –