关于屏幕方向的问题

在cocosd-x-2.2.1中例子默认的屏幕方向为水平方向,为了设置屏幕方向为竖直方向,对RootViewController.mm中的下面三个函数进行了修改:

//RootViewController.mm
// Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape( interfaceOrientation );
return UIInterfaceOrientationIsPortrait( interfaceOrientation ); //modified
}

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown;
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; //modified
#endif
}

- (BOOL) shouldAutorotate {
//return YES;
return NO; //modified
}


```

但运行后模拟器的方向仍然为水平的,请教各位前辈,要使模拟器方向为竖直方向该怎么修改呢?谢谢了!

工程设置改了么?

— Begin quote from ____

引用第1楼tinko于2013-12-07 01:39发表的 :
工程设置改了么? http://www.cocoachina.com/bbs/job.php?action=topost&tid=170423&pid=858412

— End quote

没有,请问在哪设置呢?

— Begin quote from ____

引用第1楼tinko于2013-12-07 01:39发表的 :
工程设置改了么? http://www.cocoachina.com/bbs/job.php?action=topost&tid=170423&pid=858412

— End quote

谢谢,通过你的提示,已解决,谢谢了

我也有这问题 请问硬件在哪改?

各个版本的xcode,这里显示不一样。红色标记就是修改模拟器显示横竖屏设置。
portrait 竖屏
Landscape 横屏