最新消息:20210917 已从crifan.com换到crifan.org

【已解决】iOS中iPhone6 Plus的启动页面出错不显示

iOS crifan 2102浏览 0评论

Xcode中已经配置好了 iPhone 6Plus的图片:Content.json

{
  "images" : [
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "启动页_1242x2280.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "3x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "667h",
      "filename" : "启动页_750x1334.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "2x"
    },
    {
      "orientation" : "portrait",
      "idiom" : "iphone",
      "filename" : "启动页_640x960.png",
      "extent" : "full-screen",
      "minimum-system-version" : "7.0",
      "scale" : "2x"
    },
    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "retina4",
      "filename" : "启动页_640x1336.png",
      "minimum-system-version" : "7.0",
      "orientation" : "portrait",
      "scale" : "2x"
    },
    {
      "orientation" : "portrait",
      "idiom" : "iphone",
      "filename" : "启动页_640x960-1.png",
      "minimum-system-version" : "7.0",
      "scale" : "2x"
    },
    {
      "orientation" : "portrait",
      "idiom" : "iphone",
      "filename" : "启动页_640x1336-1.png",
      "minimum-system-version" : "7.0",
      "subtype" : "retina4",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

但是启动就是没有生效:

而不是正常的:

iOS 的 APP 在系统中如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸? – 知乎

以为是3x图没有配置,但是发现配置了的:

    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "启动页_1242x2280.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "3x"
    },

iPhone 6Plus 启动界面 content.json

app图标和启动图以及Images.xcassets – 简书

iPhone 6Plus content.json launch image

去官网看了看:

Asset Catalog Format Reference: Launch Image Type

Asset Catalog Format Reference: Image Set Type

-》感觉此处的配置是没有问题的啊。

iOS 的 APP 在系统中如何适应 iPhone 5s/6/6 Plus 三种屏幕的尺寸? – 知乎

“值得注意一点是,iPhone 6 Plus。它的宽高是414 × 736个点,3x模式,理想上来说,应该有1242 × 2208像素。”

app图标和启动图以及Images.xcassets – 简书

“iPhone6 plus1242x2208”

Default (Launch) Image – iOS Developers

“For iPhone

pre iPhone5

Default.png (320x480px) – "iPhone Portrait iOS5,6 – 1x"

Default@2x.png (640x960px) – "iPhone Portrait iOS5,6 – 2x" and  "iPhone Portrait iOS7,8 – 2x"

iPhone5

Default-568h@2x.png (640x1136px) – "iPhone Portrait iOS5,6 – Retina 4" and "iPhone Portrait iOS7,8 – Retina 4"

iPhone 6

Default-iPhone6.png (750 x 1334) – "iPhone Portrait iOS8 – Retina HD 4.7"

iPhone 6 Plus

Default-iPhone6Plus.png (1242 x 2208) – "iPhone Portrait iOS8 – Retina HD 5.5" and "iPhone Landscape iOS8 – Retina HD 5.5"

Landscape images are not supported for earlier iPhone versions.

For iPad

Default-Portrait~ipad.png (768x1024px)

Default-Landscape~ipad.png (1024x768px)

Default-Portrait@2x~ipad.png (1536x2048px)

Default-Landscape@2x~ipad.png (2048x1536px)

Possible Other iPad Images

Default-PortraitUpsideDown.png

Default-LandscapeLeft.png

Default-LandscapeRight.png

Default-PortraitUpsideDown@2x.png

Default-LandscapeLeft@2x.png

Default-LandscapeRight@2x.png”

-》我们此处的是1242×2280

-》感觉是尺寸搞错了?

此处先去确认,把图片尺寸改为正确的:

1242×2208

ios – Issue with launch image in iPhone 6S plus and iPhone 7 plus – Stack Overflow

这人貌似也是6P或7P中,图片的尺寸没有给最合适的:1242×2208,所以导致不显示的?

【总结】

此处,确保Content.json中的配置正确:

    {
      "extent" : "full-screen",
      "idiom" : "iphone",
      "subtype" : "736h",
      "filename" : "启动页_1242x2208.png",
      "minimum-system-version" : "8.0",
      "orientation" : "portrait",
      "scale" : "3x"
    },

且确保(用于5.5寸的iPhone 6Plus或7Plus的)图片“启动页_1242x2208.png”本身的尺寸是1242×2208,就可以正常显示启动页面了。

转载请注明:在路上 » 【已解决】iOS中iPhone6 Plus的启动页面出错不显示

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.196 seconds, using 23.33MB memory