UITabBarController
回転の問題を処理するためのサブクラスがあります。
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations{
return [self.selectedViewController supportedInterfaceOrientations];
}
-(BOOL)shouldAutorotate{
return YES;
}
そして今UIViewController
、tabbatcontroller
私は新しいものを提示しUIViewController
ます:
MainVC *mainVC = [[MainVC alloc] initWithNibName:@"MainVC" bundle:nil];
UINavigationController *mainNav = [[UINavigationController alloc] initWithRootViewController:mainVC];
radioNav.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mainNav animated:YES];
そして、この新しいナビゲーションでは、自動回転を無効にして縦向きのみを許可したい:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
-(BOOL)shouldAutorotate{
return NO;
}
しかし、回転はまだ機能しており、画面を回転するとアプリが横向きの画面になります。この問題を解決するにはどうすればよいですか?