xcode 启动 iPhoneX 的图像名称?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46326405/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:16:06  来源:igfitidea点击:

Launch Image names of iPhoneX?

iphonexcodeios11xcode9iphone-x

提问by lauren1573

A question about iPhoneX. I want put Launch Image of iPhoneX( 1125px × 2436px) in common folder. Not in LaunchImage source. What's the Launch Image names of iPhoneX? just like 'Default-iOS8-736h@3x', I can not found the name in https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/.

关于 iPhoneX 的问题。我想将 iPhoneX(1125px × 2436px)的 Launch Image 放在公共文件夹中。不在 LaunchImage 源中。iPhoneX 的 Launch Image 名称是什么?就像“Default-iOS8-736h@3x”一样,我在https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/launch-screen/ 中找不到该名称 。

回答by Juan José Rubio

You can add static launch image for iPhone X, only add: [email protected]

您可以为 iPhone X 添加静态启动图片,只需添加: [email protected]

回答by Valentin Shergin

Following the convention it should be named [email protected](and [email protected]) (812 is the actual height in points). And looks like currently there is no way to use storyboard-powered launch screen and have pixel perfect images for both iPhone X and old plus sizes models.

按照惯例,它应该被命名[email protected](和[email protected])(812 是实际高度,以磅为单位)。看起来目前没有办法使用故事板驱动的启动屏幕并为 iPhone X 和旧的大尺寸机型提供像素完美的图像。

回答by DzungPV

You can add static launch image for iPhone X with old project with simple step:

您可以通过简单的步骤使用旧项目为 iPhone X 添加静态启动图像:

1, Select Assets.xcassets select launch image folder.
2, Check "iOS 8.0 and later" in the right Attribute inspector panel.
3, An iPhone X place holder will appear, drag an image 375w812h @ 3x to it and you are done.

回答by iamhite

If the launchImage source name is 'LaunchImage'. setting in General Tab

如果 launchImage 源名称是“LaunchImage”。 在常规选项卡中设置

The name should be [UIImage imageNamed:@"[email protected]"]

名字应该是 [UIImage imageNamed:@"[email protected]"]

PS: how to find it ?

PS:怎么找?

  1. step 1. Open the bundle directory like /Users/hite/Library/Developer/CoreSimulator/Devices/5CFE3CFA-94F8-45EC-BAC5-xxx2/
  2. Find your application file like myFit.app, and Show Package Contents.
  3. search for the 3x.png to get the image name.
  1. 步骤 1. 打开包目录,如 /Users/hite/Library/Developer/CoreSimulator/Devices/5CFE3CFA-94F8-45EC-BAC5-xxx2/
  2. 找到您的应用程序文件,如myFit.app、 和Show Package Contents
  3. 搜索 3x.png 以获取图像名称。

回答by Jochen

You can define the names in your Info.plistusing the UILaunchImagesKey:

您可以Info.plist使用UILaunchImagesKey定义名称:

<key>UILaunchImages</key>
<array>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-736h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{414, 736}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-667h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 667}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>7.0</string>
        <key>UILaunchImageName</key>
        <string>Default</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 480}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>7.0</string>
        <key>UILaunchImageName</key>
        <string>Default-568h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{320, 568}</string>
    </dict>
    <dict>
        <key>UILaunchImageMinimumOSVersion</key>
        <string>8.0</string>
        <key>UILaunchImageName</key>
        <string>Default-812h</string>
        <key>UILaunchImageOrientation</key>
        <string>Portrait</string>
        <key>UILaunchImageSize</key>
        <string>{375, 812}</string>
    </dict>
</array>

Landscape images would work the same.

风景图像也一样。