【问题标题】:After xcodegen, screen size is not full screenxcodegen后,屏幕大小不是全屏
【发布时间】:2022-10-02 18:40:14
【问题描述】:

当我刚刚创建一个项目时,屏幕看起来很好,它完全反映了我在故事板上看到的内容,并且在 pod install 之后看起来也很好。但是在 xcodegen 生成之后,屏幕看起来像图片,所以我假设 xcodegen 影响了屏幕视图,但不确定发生了什么变化。 project.yml 仅包含依赖包。 有谁知道是什么决定了屏幕尺寸?

    标签: ios swift xcode xcodegen


    【解决方案1】:

    当没有指定启动屏幕时会发生这种情况。在您的project.yml 中,在UILaunchScreen 下添加一些内容,如下所示:

    targets:
      MyApp:
        type: application
        platform: iOS
        deploymentTarget: "15.0"
        sources: [MyApp]
        info:
          path: MyApp/Resources/Info.plist
          properties:
            UILaunchScreen:
              UIImageName: LaunchImage
    

    其中LaunchImage 是资产目录中图像的名称。或者,使用 UIColorName 指定颜色。该颜色也必须在您的资产目录中。

    【讨论】:

      猜你喜欢
      • 2013-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-09-23
      • 2023-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多