我已经实施了MGSplitViewController
,并注意到当iPad模拟器和设备处于横向模式时调用willRotateToInterfaceOrientation:duration:
和didRotateFromInterfaceOrientation:
,而不是纵向模式时调用- (void) viewDidAppear:(BOOL)animated {
NSLog(@"%@", NSStringFromSelector(_cmd));
NSLog(@"%@", [NSString stringWithFormat:@"self.interfaceOrientation: %@", (self.interfaceOrientation == UIInterfaceOrientationPortrait) ? @"Portrait" : @"Landscape"]);
if (UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
splitViewController.vertical = YES;
[splitViewController toggleMasterView:self];
[splitViewController toggleSplitOrientation:self];
}
}
和willRotateToInterfaceOrientation:duration:
。当我在以下时间执行以下操作时:
didRotateFromInterfaceOrientation:
当我以纵向或横向显示设备时,日志始终打印纵向。
self.interfaceOrientation
,viewDidAppear:
仅在风景中被调用?谢谢,