如何设置默认方向

时间:2012-06-25 02:32:35

标签: objective-c ios cocoa-touch device-orientation

  

可能重复:
  how to set Orientation after launch on iPhone

我如何设置应用程序的默认方向,如启动画面所在的方向,以及应用程序在自动旋转之前的位置?

2 个答案:

答案 0 :(得分:0)

只需执行以下操作:

- 将“初始接口方向”键添加到info.plist。

- 将值更改为所需的方向(作为字符串;有关可能的字符串值,请参阅“支持的接口方向”)。

答案 1 :(得分:-1)

-(void)shouldAutoRotateInterfaceOrientation委托中,如果您希望将横向设置为默认值,请按此放置:

return UIInterfaceOrientationLandscapeLeft