iPhone 6S plus 和 iPhone 7 plus 中的启动图像问题
Posted
技术标签:
【中文标题】iPhone 6S plus 和 iPhone 7 plus 中的启动图像问题【英文标题】:Issue with launch image in iPhone 6S plus and iPhone 7 plus 【发布时间】:2016-11-10 11:52:05 【问题描述】:我对 Xcode 很陌生。我的应用程序启动屏幕有某些图像。我已经通过拖放将它们添加到图标(Images.xassets -> LaunchImage)。
它们都可以在除 iPhone 6s plus 和 iPhone 7 plus 之外的所有设备上正常工作。
我的 contents.json 文件如下所示
"images" : [
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"scale" : "1x"
,
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "ios_portrait_640x1136.png",
"extent" : "full-screen",
"scale" : "2x"
,
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "iOS_portrait_640x1136-1.png",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_750x1334.png",
"extent" : "to-status-bar",
"scale" : "1x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_750x1334-1.png",
"extent" : "full-screen",
"scale" : "1x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_1136x640.png",
"extent" : "to-status-bar",
"scale" : "1x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_1136x640-1.png",
"extent" : "full-screen",
"scale" : "1x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_1536x2048.png",
"extent" : "to-status-bar",
"scale" : "2x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_1536x2048-1.png",
"extent" : "full-screen",
"scale" : "2x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_2048x1536-2.png",
"extent" : "to-status-bar",
"scale" : "2x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_2048x1536-3.png",
"extent" : "full-screen",
"scale" : "2x"
,
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iOS_portrait_1080x1920.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
,
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iOS_landscape_2048x1536-1.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
,
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "iOS_portrait_750x1334-2.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
,
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
,
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "iOS_portrait_640x1136-2.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_750x1334-3.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_1334x750.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
,
"orientation" : "portrait",
"idiom" : "ipad",
"filename" : "iOS_portrait_1536x2048-2.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
,
"orientation" : "landscape",
"idiom" : "ipad",
"filename" : "iOS_landscape_2048x1536.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
],
"info" :
"version" : 1,
"author" : "xcode"
我使用的是 Xcode 8,部署目标是 iOS 10.0
任何帮助将不胜感激
【问题讨论】:
我建议使用启动故事板。添加一个 UIImage 视图,将其约束到屏幕边缘并让 iOS 为您缩放图像 【参考方案1】:改变你的
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iOS_portrait_1080x1920.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
,
到
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "iOS_portrait_1242x2208.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
,
并确保您的图像 iOS_portrait_1242x2208.png 分辨率确实是 1242x2208。
【讨论】:
以上是关于iPhone 6S plus 和 iPhone 7 plus 中的启动图像问题的主要内容,如果未能解决你的问题,请参考以下文章
我在 Xcode 的自动布局部分的底部没有看到 iPhone 6、6S 尺寸来调整我的视图。我只看到 4s、SE、7 和 7 Plus 尺寸
Alamofire 上传仅在 iphone 6s plus 上崩溃
UIButton 或 UIBarButtonItem 在 iPhone 6s 和 6s plus 上反应不佳