【问题标题】:iOS App Landscape Mode Launch Image Not ShowingiOS 应用横向模式启动图像不显示
【发布时间】:2015-01-30 11:07:35
【问题描述】:

我只在横向模式下开发 iOS 应用程序。我将 Launchscreen 图像加载为:Default@2x.png、Default-568h@2x.png、Default-667h@2x.png、Default-736h@3x.png。

问题是每当我在 iPhone6 或 6+ 中启动应用程序时,它都会从 iphone5 获取屏幕尺寸。

附:我试过使用 Images.Xcassets 但它不适用于 iPhone

谢谢。

【问题讨论】:

    标签: ios objective-c launchimage


    【解决方案1】:

    阅读 Apple 提供的iOS Human Interface Guidelines 并确认您的所有图像是否符合要求的尺寸。还要检查图像命名约定是否合适。

    因为应该根据设备及其方向自动拾取启动图像。

    这是链接:

    https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW2

    【讨论】:

      【解决方案2】:

      如果您的应用是横向的,您必须在应用设置的常规选项卡中的“设备方向”部分选中“纵向”选项。然后你需要为所有视图控制器设置方向设置:

      -(BOOL)shouldAutorotate
      {
          return YES;
      }
      
      -(NSUInteger)supportedInterfaceOrientations
      {
          return UIInterfaceOrientationMaskLandscapeLeft |
          UIInterfaceOrientationMaskLandscapeRight;
      }
      
      -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
      {
          return  UIInterfaceOrientationLandscapeLeft;
      }
      

      在 Images.xcassets 中,您需要放置适用于 iOS 7 和 8 的所有图像。之后,应用程序将使用正确的启动图像启动。请注意,preferredInterfaceOrientationForPresentation 必须与启动图像方向相同。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-03-01
        • 1970-01-01
        • 2012-02-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-01-15
        • 1970-01-01
        相关资源
        最近更新 更多