2011-11-30 43 views
2

我有一个我只想在横向视图中看到的iPad游戏。我选择从目标的总结横向视图,并让代码支持的方向不限制实际的方向

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

在其中加入navController我的第一个视图控制器。但是通过改变目标的方向我可以看到的唯一影响不是它如何旋转,而是它首先加载的方向。有没有人有任何想法?谢谢!

回答

2

试试这个:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 
+0

它有趣,像我viewcontrollers的90%的工作,但由于某种原因只是其中之一锁定在横向模式下,但它不会允许它是否能够旋转180°我把它翻过来......想法? –