我的AppDelegate.mm有以下代码:
- (voID) applicationDIDFinishLaunching:(UIApplication*)application---------some code#if GAME_autoROTATION == kGameautorotationUIVIEwController NSLog(@"if"); [director setDeviceOrIEntation:kCCDeviceOrIEntationLandscapeleft];#else NSLog(@"else"); [director setDeviceOrIEntation:kCCDeviceOrIEntationPortrait];#endif---------somecode
我的GameConfig.h有:
#define GAME_autoROTATION kGameautorotationUIVIEwController
我的RootVIEwController.m有:
if GAME_autoROTATION == kGameautorotationUIVIEwController return ( UIInterfaceOrIEntationIsLandscape( interfaceOrIEntation ) );
我的Xcode设置是:
-(NSUInteger)supportedInterfaceOrIEntations { // iPhone only if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ) return UIInterfaceOrIEntationMaskLandscape; // iPad only return UIInterfaceOrIEntationMaskLandscape;}总结
以上是内存溢出为你收集整理的Cocos2d-iOS中的设备方向全部内容,希望文章能够帮你解决Cocos2d-iOS中的设备方向所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)