我想出来了:
在显示加载屏幕之后,我正在加载视图。因此,它无法正确检测方向。在将视图添加到窗口之前,我添加了这个手动检查,它解决了我的问题。
CGRect frame = [[UIScreen mainScreen] applicationFrame];
switch(controller.interfaceOrientation){
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
[controller.view setFrame:frame];
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
[controller.view setFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.height, frame.size.width)];
break;
}