0

我是 Xcode 和 iOS 编程的新手,所以我可能不明白你告诉我的内容,但还是试试吧。我正在为一个学校项目创建一个应用程序,这将都是横向的。在情节提要中,我添加了许多 ViewControllers 来表示不同的场景,它们都处于横向模式。但是,当我启动模拟器时,在第一个场景之后,它会切换到纵向。我支持的设备方向设置为:横向左,横向右。在情节提要中,在选择 ViewController 的同时,我还将方向更改为横向。

4

3 回答 3

0

您必须将以下代码放在每个视图控制器中

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
 return ((interfaceOrientation == UIInterfaceOrientationLandscapeLefr)||(interfaceOrientation == UIInterfaceOrientationLandscapeRight))
}
于 2012-02-06T07:37:31.730 回答
0

您是否将方向 (UISupportedInterfaceOrientations) 添加到 plist 中?

于 2012-02-06T07:38:47.843 回答
0

观看来自“Geeky Lemon Development”的 YouTube视频。

这将解释如何将您的应用程序设置为横向。

它将设备启动方向设置为横向。

请记住,在开发要在 iPad 上发布的应用程序时,您必须同时支持两种方向(横向和纵向)。

于 2012-03-28T15:56:59.433 回答