我正在开发一个 iPad 应用程序,我在其中处理图像。当应用程序以纵向模式启动时,该应用程序在纵向模式下运行良好,但是当我以横向模式启动应用程序时,它给我带来了可笑的框架问题。我的所有功能都已经写在“ shouldAutorotateToInterfaceOrientation ”这个方法中了。如果我能够调用此方法,那么它将消除所有帧问题。我如何在我的应用程序中的任何函数中调用 shouldAutorotateToInterfaceOrientation 方法?
问问题
1643 次
2 回答
2
你不给shouldAutorotateToInterfaceOrientation:
自己打电话。UIKit 将此消息发送到您的视图控制器,以了解视图控制器是否应该旋转。将您的布局代码从shouldAutorotateToInterfaceOrientation:
to移动willRotateToInterfaceOrientation:
,它应该可以工作。
于 2011-02-02T06:45:50.350 回答
0
shouldAutorotateToInterfaceOrientation:
此方法的实现应该根据 interfaceOrientation 参数中的值简单地返回YES或NO 。不要尝试获取 interfaceOrientation 属性的值或检查 UIDevice 类报告的方向值。您的视图控制器要么能够支持给定的方向,要么不能。
于 2011-02-02T06:49:23.023 回答