zoukankan      html  css  js  c++  java
  • 强制设置页面横竖屏的问题

    有的时候有的需求会让页面强制的横竖屏转换,再之后的ios的版本中,- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation被官方废弃了,不能继续使用的,下面是ios6之后的强制横竖屏的方法:

    -(BOOL)shouldAutorotate

    {

        return YES;

    }

    -(UIInterfaceOrientationMask)supportedInterfaceOrientations

    {

        return UIInterfaceOrientationMaskLandscape;

    }

    -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation

    {

        return UIInterfaceOrientationLandscapeRight;

    }

    -(BOOL)prefersStatusBarHidden

    {

        return NO;

    }

     还有一点需要说明的是,跳转到下一个页面强制横竖屏的时候只能使用presentViewController,而不能使用push跳转的方法,切记!!!

  • 相关阅读:
    冲刺周期会议三
    冲刺周期会议二
    冲刺周期会议一
    日常会议
    总结会议及站立会议(六)
    站立会议(五)
    站立会议(四)
    【自习任我行】
    软件小创意
    团队项目题目拟定
  • 原文地址:https://www.cnblogs.com/Acee/p/5007736.html
Copyright © 2011-2022 走看看