【发布时间】:2011-07-21 16:24:12
【问题描述】:
我已将我的 iPod 更新到 iOS5 并将 xcode 更新到 4.2,但我的应用程序视图都没有在横向运行我做了以下操作:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
虽然这一行的默认值是:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
在我看来,我已将方向设置为横向。 在“支持的设备方向”下的摘要中,我只选择了横向。 最后在 Info.plist 中我添加了 Initial interface orientation = Landscape (left home button)
因此,当我在运行 iOS5 的 iPod 和 iPhone 模拟器上运行时,设备会向左旋转,但视图不会移动太多。
但如果我在运行 4.2 的 iPhone 模拟器上运行它,它会旋转并变成横向。
我不知道这是我在新的 iOS/xcode 上做错了什么还是有问题。
提前致谢。 以利
更新问题已解决: 是因为
初始界面方向 = 横向 (左主页按钮)
改成
初始界面方向 = 纵向(底部主页按钮)
【问题讨论】:
-
您应该在答案中写下您的解决方案,然后将其标记为正确。它可以更容易地检查是否有答案,并获得声誉!