2011-08-09 132 views
1

我是一个新的bie,用于堆叠流和iphone开发,我只需在横向模式下启动我的应用程序。为此,我在信息中设置了键。 plist和写在方向delegete ..但结果仍然是相同的。我做了一个巨大的研究,但尚未成功..我的Xcode版本是3.2.26,我的基本模板是基于tabbar ..非常感谢你您有关于我的问题的一些建议,真诚仅在横向模式下启动应用程序,并在横向模式下锁定应用程序

谢谢

普里亚(印度)

回答

1

你需要这样做

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

return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 

} 
+0

我已经这样做,但仍:(:((( –

+0

它肯定是工作。你把代码放到你的视图控制器中了吗? – Vanya

+0

按照我的建议。您错过了您的info.plist文件中的启动方向。 –

0

首先定义你的Info.plist文件以下键值对:

UIInterfaceOrientation UIInterfaceOrientationLandscapeLeft 

或UIInterfaceOrientationLandscapeRight或定义景观正确的方向初始启动后在所有的控制器在以下定义shouldAutorotateToInterfaceOrientation方式:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 
相关问题