【发布时间】:2012-02-14 22:55:32
【问题描述】:
我正在为 iOS 5 开发一个应用程序,它必须在横向模式下运行。我的问题是我最初无法让它翻转。
我已经尝试将“初始界面方向”设置为“横向(右主页按钮)” 并将以下方法添加到我的视图控制器:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
我可以理解它应该如何工作。 (我找到了代码here)
我也想知道如何使用 Xcode 4.2 项目设置中提供的“支持的设备方向”,它似乎没有做任何事情。
我一直在浏览网站,但找不到解决我问题的示例。
谢谢。
【问题讨论】:
标签: objective-c ios5 xcode4.2