cocos2d 2.0 i0S6 中如何实现横屏

如题所示。在网上找了几种方法都不管用,请知道的大大不吝赐教。

新建cocos2d模板里的RootViewController.h不是有方法吗

没有看到有RootViewController.h

RootViewController.mm里面有2个函数,这2个函数是设置横竖屏的。

*/

// Override to allow orientations other than the default portrait orientation.

// This method is deprecated on ios6

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

return UIInterfaceOrientationIsLandscape( interfaceOrientation );

}

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead

- (NSUInteger) supportedInterfaceOrientations{

#ifdef __IPHONE_6_0

return UIInterfaceOrientationMaskLandscape;

#endif

}

您这貌似是cocos2d-x,我用的是for iPhone 2.0

2d的好像也有个类似的吧