The cocos2d-x is compiled onto iOS. The default is a horizontal screen, to change to http://Vertical screen. Different iOS version numbers. Methods can also be different
On The iOS7, perhaps we set the screen. But it may change on the IOS6. Here 's What I'm doing for you.
Reprint Please specify address http://blog.csdn.net/u010229677
1, the General
just need to rootviewcontroller.mm the file's face
-(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;}
———— can do the same —————
if ([[Uidevice Currentdevice] Respondstoselector: @selector (setorientation:)]) {[[Uidevice Currentdevice] Performselector: @selector (setorientation:) withobject: (ID) uiinterfaceorientationportrait];}} But-(BOOL) shouldautorotate { return NO;} Be sure to return no
In addition, the project needs to be General Properties Deployment Info Portrait Front selected
2, can set the view and the battery bar direction to keep consistent
In the AOOCONTROLLER.MM
<span style= "FONT-SIZE:18PX;" >-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions </span>
Add a sentence in this function
[[UIApplication sharedapplication] setstatusbarorientation:uideviceorientationportrait Animated:no];
The way to change the Android project to horizontal screen is to change the XML file:
in the set in androidmanifest.xml
android:screenorientation= "Portrait"
Cocos2dx how to set up iOS and Android horizontal screen vertical screen several ways