清秋梧桐

导航

杂乱代码

  • 调整iPhone或者iPad只适应横屏的方法

    //重写UIViewController的这个方法。这个方法判断当前的UIViewController都支持哪个方向

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

     

     

    //如果return YES;设备旋转的时候ViewController里面的内容自动跟着旋转.
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft ) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

     

    }

posted on 2012-11-14 17:34  清秋梧桐  阅读(138)  评论(0编辑  收藏  举报