基于mac平台上用cocos2dx开发屏幕竖屏设置 x-code5

Posted on 2014-08-12 12:33  冷清秋_此去经年  阅读(189)  评论(0)    收藏  举报


第一步

左侧项目栏里面找到RootViewController.mm


/ Override to allow orientations other than the default portrait orientation.
// This method is deprecated on ios6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    
    return UIInterfaceOrientationIsPortrait( interfaceOrientation );  //竖直

   // return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}

// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
    //return UIInterfaceOrientationMaskAllButUpsideDown;
    return UIInterfaceOrientationMaskPortrait;
#endif
}
找到上面这段就好了




第二步


点击项目 名称就是项目烂第一个然后找到  deployment info  这个栏目 把    Device Orientation里面得 Portrait 打上勾  ok了







博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3