我的应用程序应该只支持横向模式,所以我配置 info.plist 键以正确的方式获取它。
我的根视图控制器是一个自定义 UINavigationController 我添加到主窗口并实现
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
问题是,在 applicationDidFinishLaunching 之后,interfaceOrientation
即使应用程序以 UIInterfaceOrientationLandscapeLeft 方向启动,它也始终是 UIInterfaceOrientationLandscapeRight。
结果是启动图像的方向正确,而应用程序是颠倒的。
摇晃设备片刻,使控制器再次按正确方向旋转。
它是一个错误吗?我该如何解决这个问题?