cocos2d中项目默认是横屏的,但是有时需要竖屏显示,如何实现呢?

找到项目中RootViewController.m文件,打开它,差不多在所有代码的中间位置(大约第90行),有这样一句:
return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
这一句是设置设备为横屏,改成如下:
return ( UIInterfaceOrientationIsPortrait( interfaceOrientation ) );这样,设备就是竖屏显示了。
如下图:
