我正在构建一个应用程序,它在iOS 4.3下只支持iPad上的横向方向,尽管在iOS 4.2下也存在这个错误。
在应用程序中的几个地方,我将UIViewController显示为模式视图。所有这些都是使用以下模式显示的:
viewController.modalPresentationStyle = UIModalPresentationFormSheet;
viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:viewController animated:YES];在大多数地方,它们都像预期的那样工作--模式表单表单从屏幕底部向上滑动。
但是,在两种情况下,模式表单表单从屏幕的左下角滑入。表单几乎一直向右滑动,表单的底部从视图中消失。
我不认为XIB的模拟指标会影响它们的行为,但我已经将所有XIB的方向(调用UIViewController self和模式视图控制器viewController)都设置为Landscape。
您知道为什么这两个模式表单的行为与其他表单不同吗?
发布于 2012-07-21 15:16:59
我认为在这里你不能在shouldAutorotate函数中返回横向方向,所以如果你想要以左/右的横向视图查看,请使用以下代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight||interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
// return YES;
}试试这个,可能会对你有帮助。
发布于 2012-07-21 16:47:37
如果在NavigationController中嵌入了viewController,请确保navController shouldAutotorate也设置为横向
https://stackoverflow.com/questions/5200349
复制相似问题