UITabBarController에 5 개의 내비게이션 컨트롤러가 있습니다. UITabBarController가에서 있는 navigationController 중 하나는 내가 있는 navigationController 서브 클래스에 넣어 하나 의 ViewController 항상 가로 다른 모든 세로 .. 코드 위UITabBarController에서 특정 뷰 컨트롤러를 가로로 표시합니다.
-(BOOL)shouldAutorotate
{
return [self.topViewController shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [self.topViewController supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [self.topViewController preferredInterfaceOrientationForPresentation];
}
있습니다.
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
는 위의 코드 나는 풍경 컨트롤러에 넣어.
나는 그것이 작동의 ViewController 아니라 단지 풍경이 화면을 표시하는 것이있는 경우이 코드
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
if ([self isKindOfClass:[LanscapeViewController class]])
return UIInterfaceOrientationLandscapeLeft;
else
return UIInterfaceOrientationPortrait;
}
을 넣어한다는 점에서 UIViewController 하위로 자료를 가지고 ..하지만 세로 남아있는 의 ViewController 밀어 경우 .
이 문제를 해결할 수 있습니까?
미리 감사드립니다.
Pls는 검사로 방향 방법을 구현하려는
의 UIViewController 카테고리 가져 오기의 ViewController 위
Appdelegate.m
수입에서, 현재의 ViewController를 확인하기 위해UIViewController
카테고리 만들기 내 업데이트 된 질문 .. – TamilKing@ TamilKing, 동급의 동일 클래스 내에서 왜 당신이 kindClass를 확인 했습니까? 이 if ([self isKindOfClass : [LanscapeViewController class]]) 조건은 항상 같은 LanscapeViewController 클래스에 있기 때문에 true입니다. 모든 Landscape VC에서 모든 세로 VC와 UIInterfaceOrientationLandscapeLeft에서 UIInterfaceOrientationPortraitUpsideDown을 반환하십시오. – Punita
그 UIViewcontroller의 하위 클래스입니다 그래서 모든 하위 클래스 아래에있는 viewcontroller 그래서 내가 이렇게 체크 .. 그래서 oly .. @ Punita – TamilKing