5
가로 모드에서 1 개 또는 2 개의 UIViewcontroller를 표시하고 다른 모드에서는 세로로 표시하려고합니다. 이 목적을 위해 AppDelegate에서이 함수를 구현했습니다. 내가 가로 방향이 필요 UIViewController에 (들)에서iOS9 supportedInterfaceOrientationsForWindow 호출이 중지됩니다.
@property (nonatomic, assign) UIInterfaceOrientationMask orientation;
: AppDelegate.h에, 방향이
-(UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
return self.orientation;
}
. 나는이 코드를
-(void)viewWillAppear:(BOOL)animated
{
self.appDelegate.orientation = UIInterfaceOrientationMaskLandscape;
}
및
-(void)viewWillDisappear:(BOOL)animated
{
self.appDelegate.orientation = UIInterfaceOrientationMaskPortrait;
}
그러나, 나는 'LandscapeViewController'이 확인 작동에 갈 때, 나는 돌아가고, 그것은, 내가 다시 그 확인 '을 LandscapeViewController'에 가서 작품을 좋아
를 배치 그리고 나서 돌아 왔을 때, supportedInterfaceOrientationsForWindow 메소드가 호출되는 것을 멈 춥니 다. 그 이유가 뭐야? 아니면 내가 이상한 일을하고있는거야?
예 내가 TabBar의를 사용하고 뷰 컨트롤러에이를 배치합니다. – Haris