Skip to content

Instantly share code, notes, and snippets.

@tadamatu
Last active October 21, 2015 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadamatu/742ad35e667f472d34ae to your computer and use it in GitHub Desktop.
Save tadamatu/742ad35e667f472d34ae to your computer and use it in GitHub Desktop.
cocos2d-xの画面の向き(縦横)は設定だけでは済まないのでまとめておく ref: http://qiita.com/tadamatu/items/98a9539ab3dd951489f5
<activity android:name="org.cocos2dx.cpp.AppActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" //★この部分★
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation">
// 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 ); //縦
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
-(NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
//return UIInterfaceOrientationMaskAllButUpsideDown; //横
return UIInterfaceOrientationMaskPortrait; //縦
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment