新手手机游戏开发,横屏的, 积分墙广告只支持竖屏,需要临时换一个方向,怎么处理?

解决方案 »

  1.   

    网上的例子,可以参考http://blog.csdn.net/dongge_111/article/details/7394950http://www.istar.name/blog/ios-development-rotation
      

  2.   

    先试试这个吧,先保证横屏和竖屏都可行。然后在横屏ViewControllers中,添加这个:-(NSUInteger)supportedInterfaceOrientations{
        return UIInterfaceOrientationMaskLandscape;
    }
    在竖屏的ViewController中添加:-(NSUInteger)supportedInterfaceOrientations{
        return UIInterfaceOrientationMaskPortrait;
    }
      

  3.   

    如果不是ios6版本可以用在AppDelegate,实现积分榜横屏。// 需要支持横向.根据需要自定义
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return UIInterfaceOrientationIsLandscape(interfaceOrientation);
    }#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0
    - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
    {
        return UIInterfaceOrientationMaskAllButUpsideDown; //要是这里出现问题可能是xcode版本,xcode版本要4.5+
    }
    #endif设置为横屏模式
      

  4.   

    http://blog.csdn.net/xuanwenchao/article/details/7979744第5个
      

  5.   

    http://blog.csdn.net/duxinfeng2010/article/details/8024379