【问题标题】:how can i stop the orientation change in iPad?如何停止 iPad 中的方向更改?
【发布时间】:2011-02-21 14:45:35
【问题描述】:

我正在使用 ipad。在我的项目中,它需要看到纵向,而不是横向。现在,如果我打开我的 ipad,我的项目也会变成横向模式。

但我需要的是,如果有人也打开他们的 ipad,我的页面视图不应该变成横向。不是意味着我的网页总是应该处于纵向模式。为此,我怎样才能停止方向变化?

并让我的网络视图始终为纵向?

有人帮帮我吗?

【问题讨论】:

    标签: ipad mobile-safari screen-orientation


    【解决方案1】:

    你想像这样实现shouldAutorotateToInterfaceOrientation

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIDeviceOriention)orientation{
      if(orientation == UIInterfaceOrientationPortrait){
         return YES;
      }
      return NO;
    }
    

    【讨论】:

    • 感谢您的建议,也许这就是我想要的。但是我该如何实现呢?
    • 将此代码添加到您怀疑要旋转的视图控制器中。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多