我试图让我的应用程序在横向和纵向上工作。我在我的所有视图控制器中都安装了正确的方法,并且此代码在 ipad 模拟器旋转时触发,但总是触发纵向。景观 IF 子句永远不会被触发。我可能做错了什么?
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)InterfaceOrientation {
NSLog(@"******* ROTATING ******");
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
NSLog(@"ROTATING View Landscape ******");
} else if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) {
NSLog(@"ROTATING View Portrait ******");
}
}
}