ios 是否可以在 iPhone 应用程序图标中使用透明度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/959864/
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
Is it possible to use transparency in an iPhone app icon?
提问by yukon
I created a 57×57 circular icon (without shine) which has transparency outside of the circle for my app. I can successfully install the app on Simulator and iPhone. It works fine, and looks great.
我创建了一个 57×57 的圆形图标(没有光泽),它在我的应用程序的圆圈外具有透明度。我可以在模拟器和 iPhone 上成功安装该应用程序。它工作正常,看起来很棒。
However, can I submit an icon with transparency to Apple? Will they accept it? I can't find any apps which have transparency in their icon. Instead, they use a kind of pseudo-transparency - a jet black background with no shine.
但是,我可以向 Apple 提交透明的图标吗?他们会接受吗?我找不到任何图标透明的应用程序。相反,他们使用了一种伪透明——没有光泽的黑色背景。
回答by Matt Hall
Apple may have updated the interface guidelines since this question was asked, but transparency is now expressly not allowed. See more here:
https://developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/
自从提出这个问题以来,Apple 可能已经更新了界面指南,但现在明确不允许透明。在此处查看更多信息:https:
//developer.apple.com/ios/human-interface-guidelines/icons-and-images/app-icon/
回答by Bruno Bronosky
When trying to prepare an app update in iTunes Connect today I uploaded a 1 layer 1024x1024 PNG in RGB 8bits/channel color mode. I got an error message stating:
今天尝试在 iTunes Connect 中准备应用程序更新时,我上传了 RGB 8 位/通道颜色模式的 1 层 1024x1024 PNG。我收到一条错误消息,指出:
"Images can't contain alpha channels or transparencies.":
“图像不能包含 Alpha 通道或透明胶片。”:
That's the rule for the App Store as recently as 2015/01/22. I'm including a screenshot.
这是最近 2015 年 1 月 22 日 App Store 的规则。我包括一个截图。
回答by Will Harris
I've looked into this for a client who would like a circular transparent icon to match his company's logo. Here's what I've found:
我已经为一位想要圆形透明图标以匹配其公司徽标的客户进行了调查。这是我发现的:
The 512x512 iTunes icon is uploading in JPEG or TIFF format, which don't support transparency, so you'd have to make up a square background for your circle. Since the home screen icon is supposed to look exactly like the large icon, your home screen icon will also have to have the same background.
512x512 iTunes 图标以 JPEG 或 TIFF 格式上传,不支持透明度,因此您必须为您的圆圈制作方形背景。由于主屏幕图标应该看起来与大图标完全一样,因此您的主屏幕图标也必须具有相同的背景。
As brandon suggestsyou could use a pre-rendered icon with a black background, but you'd be at the mercy of the App Store reviewers. The docs say your home screen icon must be a "flattened, square-imageicon that is 57x57 pixels" (my emphasis). You might get away with a circular icon with a black background, but it really depends on how the reviewer tests that requirement. You might get away with it if they don't check, or only check that the alpha channel is 100% everywhere, but won't if they decide based on whether the icon looks square.
正如布兰登所建议的那样,您可以使用带有黑色背景的预渲染图标,但您将受到 App Store 评论者的支配。文档说您的主屏幕图标必须是“ 57x57 像素的扁平方形图像图标”(我的重点)。您可能会使用黑色背景的圆形图标,但这实际上取决于审阅者如何测试该要求。如果他们不检查,或者只检查 alpha 通道在任何地方都是 100%,你可能会逃脱惩罚,但如果他们根据图标是否看起来是方形来决定,你就不会这样做。
A circular icon will look odd next to all the other icons on the users' phones, so it's probably a bad idea anyway.
圆形图标在用户手机上的所有其他图标旁边看起来很奇怪,所以无论如何这可能是一个坏主意。
回答by Kekoa
For the app, you can use your transparent PNG as the icon. When you upload to the itunes store, they require a .jpg which of course has no transparency.
对于该应用程序,您可以使用透明的 PNG 作为图标。当您上传到 iTunes 商店时,它们需要一个 .jpg,当然它没有透明度。
As for if they will accept your app with a substandard shaped icon, maybe, maybe not. The could approve it one time and then reject an upgrade, it will probably depend if they are paying attention and notice the icon or not.
至于他们是否会接受带有不合标准形状图标的应用程序,也许,也许不会。可以批准一次然后拒绝升级,这可能取决于他们是否注意并注意到该图标。
回答by Brandon Schlenker
Make all of your transparent areas black. Then add a UIPrerenderedIcon key with a value of "YES" to your applications Info.plist.
将所有透明区域设为黑色。然后将值为“YES”的 UIPrerenderedIcon 键添加到您的应用程序 Info.plist。
Otherwise it will appear shiny on the users phone.
否则它会在用户手机上显得闪亮。
回答by T.L
Yes, you can. Many my apps with icons contains alpha channel are approved (I'm lazy or forgot to remove the alpha channels). But you shouldn't use transparent pixels in the icons.
是的你可以。我的许多带有图标的应用程序都包含 alpha 通道被批准(我很懒或忘记删除 alpha 通道)。但是您不应该在图标中使用透明像素。