为什么app开始时方向错误?

时间:2013-11-12 12:06:35

标签: ios ios7 uiinterfaceorientation

我正在开发支持纵向和横向方向的iPhone应用程序。当我在横向模式下启动应用程序并验证AppDelegate中的方向时,它将返回纵向方向。旋转设备/模拟器后,它会正确返回方向。这是一个iOS 7应用程序。有谁知道如何处理这个?我需要知道启动时处理UI的方向。

1 个答案:

答案 0 :(得分:2)

UIViewController文档说:

Note: At launch time, apps should always set up their interface in a portrait orientation. After the application:didFinishLaunchingWithOptions: method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.

这就是它首先返回纵向模式的原因。有关UIViewController documentation的更多信息。