viewController
을 회전하지 않고 장치의 방향을 기준으로 아이콘을 바꿀 프로젝트에서 작업하고 있습니다. 회전 할 수있는 여러 viewController
및 내비게이션 컨트롤러에서 회전 할 수없는 다른 항목이 있습니다.shouldAutorotate = NO이고 세로 방향 만 허용되는 경우 장치 방향을 결정하는 방법은 무엇입니까?
이 구현은 내가 원하는 방식대로 작동합니다. 내 탐색 컨트롤러에서
코드 :
- (BOOL)shouldAutorotate
{
id currentViewController = self.topViewController;
if ([currentViewController isKindOfClass:[ChimpTabBarController class]]) {
ChimpTabBarController *tabbarController = (ChimpTabBarController*)currentViewController;
if (tabbarController.selectedIndex == 0){
return NO;
}
} else if ([currentViewController isKindOfClass:[RotationViewController class]] || [currentViewController isKindOfClass:[ChimpBlackoutVC class]] || [currentViewController isKindOfClass:[EditPictureVC class]]) {
return NO;
}
return YES;
}
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
id currentViewController = self.topViewController;
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
if ([currentViewController isKindOfClass:[ChimpTabBarController class]]) {
ChimpTabBarController *tabbarController = (ChimpTabBarController*)currentViewController;
if (tabbarController.selectedIndex == 0){
return (UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown);
}
} else if ([currentViewController isKindOfClass:[RotationViewController class]] || [currentViewController isKindOfClass:[ChimpBlackoutVC class]] || [currentViewController isKindOfClass:[EditPictureVC class]]) {
return (UIInterfaceOrientationPortrait | UIInterfaceOrientationPortraitUpsideDown);
}
return UIInterfaceOrientationMaskAll;
}
밖으로 내 장치에 가고 싶어 회전하는 찾을 수있는 방법이 있지만, 허용되지 않는 이유는 무엇입니까? 내가 화살표 등의 단어 ...의
감사