【问题标题】:autorotate the Ipad only not iphone仅自动旋转 Ipad 而不是 iphone
【发布时间】:2014-01-15 02:16:12
【问题描述】:

我正在开发一个应用程序,该应用程序只需要在 Ipad 中自动旋转(即横向和 Potrait 模式),这是能够实现的。但 iPhone 不需要旋转(即仅 potarit 模式)。我几乎尝试了 stackoverflow 上所有可用的代码。但没有成功。 我试过了

(NSUInteger)supportedInterfaceOrientations 

(BOOL)shouldAutorotate

但没有成功。我还在为滑动条使用 NVSlider(第三方)。我也在那个文件中写了代码,因为它也有一些与方向相关的方法,但没有结果

【问题讨论】:

    标签: iphone ipad


    【解决方案1】:

    嗯,我得到了答案。当我正在构建一个通用应用程序时,我得到了一些选择。查看图像,我们可以分别设置 iPad 和 Iphone 的方向。

    【讨论】:

      【解决方案2】:
      - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
      if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
      {
          return interfaceOrientation == UIInterfaceOrientationPortrait;
      }
      
      return YES;}
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-08-27
        • 2011-04-07
        • 1970-01-01
        • 2011-04-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多