cocos2d-x项目默认是横屏的,修改竖屏的方法是
1.AppDelegate.cpp修改:
CCSizeMake(480,320);
改成:
CCSizeMake(320,480);
2./RootViewController.mm修改以下方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return UIInterfaceOrientationIsPortrait(interfaceOrientation ); } // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead - (NSUInteger) supportedInterfaceOrientations{ #ifdef __IPHONE_6_0 return UIInterfaceOrientationMaskPortrait; #endif } - (BOOL) shouldAutorotate { return NO; }
android项目修改为横屏的方法是修改xml文件:
在AndroidManifest.xml中设置
android:screenOrientation="portrait"