2010-08-06 116 views
0

我试图制作一个使用导航控制器的风景应用程序,但我无法让应用程序在lanscape模式下启动。一旦我在另一个视图中,我使用[self.navigation popToRootViewControllerAnimated:YES];那么根视图在横向上。为什么从应用程序的发布到现实呢?在横向启动导航控制器?

我已经把它放在界面生成器中的横向模式,我已经实现了下面的代码。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 


} 

有人可以请给我解释一下。我应该在appdelegate做些什么?

回答

1

查看Info.plist key reference。在特别设置或者

  • <key>UIInterfaceOrientation</key> <string>UIInterfaceOrientationLandscapeRight</string>
  • <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeRight</string> <string>UIInterfaceOrientationLandscapeLeft</string> </array>

第二个可以让你的应用程序在两个方向启动,但只支持OS 3.2以上版本,所以你可能要包括第一个也是如此。 “LandscapeRight”似乎比仅适用于横向应用的“LandscapeLeft”更普遍。

0

尝试在应用程序的plist中添加键值对'支持的接口方向'。

+0

这似乎没有奏效。 – NextRev 2010-08-06 18:15:49

相关问题