gpt4 book ai didi

添加新图像后,iOS 7 应用程序图标立即显示为黑色

转载 作者:可可西里 更新时间:2023-11-01 03:06:13 25 4
gpt4 key购买 nike

我开始在 iOS 6 下编写这个应用程序,我成功地修复了与图像和已弃用的 API 相关的所有问题,没有任何问题。

我正在创建一个新图标来支持 iOS 7 样式,但是无论我是否使用 Assets 目录和/或图像的直接路径,只要我在启动应用程序时添加新引用,我都会呈现一个黑色图标。

我显然做错了什么。

这是我的 Assets 目录,显示了所有映射图像。它们实际上并没有出现在应用程序中,而且我在所有 iOS 应用程序中都有黑色图标。

enter image description here

每当我启动时,我都会看到一个黑色图标。是不是和Info.plist文件中的一些设置有关?

在这里。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIcons</key>
<dict/>
<key>CFBundleIcons~ipad</key>
<dict/>
<key>CFBundleIdentifier</key>
<string>com.neckbeardrepublic.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>7.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
<array>
<string>Lato-Black.ttf</string>
<string>FontAwesome.ttf</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIStatusBarHidden</key>
<false/>
<key>UIStatusBarHidden~ipad</key>
<true/>
<key>UIStatusBarTintParameters</key>
<dict>
<key>UINavigationBar</key>
<dict>
<key>Style</key>
<string>UIBarStyleDefault</string>
<key>Translucent</key>
<false/>
</dict>
</dict>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>

非常沮丧。我也刚刚尝试提供特定文件,但也没有太大用处。

谁能指出问题所在?

最佳答案

首先,检查您用于应用程序图标的图像文件是否合适。参见 Apple's Human Interface Guidelines on App Icons有关详细信息,但与此问题特别相关:

Avoid transparency. An app icon should be opaque. If the icon’s boundaries are smaller than the recommended sizes—or you use transparency to create “see-through” areas—the resulting icon can appear to float on a black background, which tends to look especially unattractive on the beautiful wallpapers that users choose.

如果您使用透明度,例如透明背景上的黑色图像,则该图标在 iOS 中可能会显示为全黑。

接下来,有几种方法可以让 iOS 了解您应用的图标。新机制是使用 Assets 目录; Apple 有关于 Migrating an App Icon or Launch Image Set 的指南.

旧的、简单的方法是将图标文件名添加到您的 Info.plist 文件 CFBundleIcons。根据 Apple 在 App-Related Resources 上的文档:

Regardless of how many different icons your app has, you specify them using the CFBundleIcons key in the Info.plist file. The value of that key is an array of strings, each of which contains the filename of one of your icons. The filenames can be anything you want, but all image files must be in the PNG format and must reside in the top level of your app bundle. (Avoid using interlaced PNGs.) When the system needs an icon, it choose the image file whose size most closely matches the intended usage.

关于添加新图像后,iOS 7 应用程序图标立即显示为黑色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19781969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com