ログインViewControllerにこれら2つのメソッドを入力します
(BOOL)shouldAutorotate { return YES;
}
(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown); }
と
(BOOL)shouldAutorotate { return YES;
}
(NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft); }
あなたの子コントローラーで
topcontroller shouldautorotate を呼び出し、インターフェイスの向きをサポートする、カテゴリの autorotation サブクラス化されたナビゲーション コントローラーを追加する必要があります。
#import "UINavigationController+Autorotation.h"
@implementation UINavigationController (Autorotation)
-(BOOL)shouldAutorotate
{
for (UIViewController * viewController in self.viewControllers) {
if (![viewController isEqual:self.topViewController]) {
[viewController shouldAutorotate];
}
}
return [self.topViewController shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
for (UIViewController * viewController in self.viewControllers) {
if (![viewController isEqual:self.topViewController]) {
[viewController supportedInterfaceOrientations];
}
}
return [self.topViewController supportedInterfaceOrientations];
}