cocos2d1.0.1x0.10.0版本 设置横屏与竖屏的方法

设置横屏与竖屏的方法

找到RootViewController.m这个文件,打开

找到这个方法

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// return YES for the supported orientations
// Only landscape  仅支持横向
// return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
// Only portrait    仅支持竖向
// return ( ! UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
// All orientations  既支持竖向又支持横向
// return YES;
}

原文地址:https://www.cnblogs.com/xuling/p/2339419.html