xcode 通过 UIPrerenderedIcon 在 iPhone 上去除光泽/光泽效果在设备上不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2958920/
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
Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device
提问by hbStarkMuffie
I have tried to use the UIPrerenderedIcon/"Icon already includes gloss and bevel" on the Info.plist of my app and it worked perfectly on the Simulator, but not on the real device (iPod touch 2g). I have even tried to uninstall the app from the device, clean all builds but I still got the shine/gloss, that's really ruining my icon... Any thoughts?
我尝试在我的应用程序的 Info.plist 上使用 UIPrerenderedIcon/“图标已经包含光泽和斜角”,它在模拟器上运行良好,但在真实设备(iPod touch 2g)上却没有。我什至试图从设备上卸载应用程序,清理所有版本,但我仍然有光泽/光泽,这真的毁了我的图标......有什么想法吗?
Best Regards, Muffie
最好的问候, 玛菲
回答by Robert
As Alex Stone said, in iOS 5 you have to edit it in 2places.
正如 Alex Stone 所说,在 iOS 5 中,您必须在2 个地方对其进行编辑。
回答by Alex Stone
Check your Plist, I found an Icon file (iOS 5) Dictionary. Within the dictionary, there's another declaration of "icon already includes gloss effects", and that one is set to NO. After setting that one to YES, your iOS5 app will lose it's gloss effect!
检查您的 Plist,我找到了一个Icon file (iOS 5) Dictionary。在字典中,还有另一个声明“图标已经包含光泽效果”,并且设置为 NO。将其设置为 YES 后,您的 iOS5 应用程序将失去光泽效果!
回答by Ian L
Just a note in case anyone stumbles across this question with the same issue using Xcode 5.0 and an asset catalog for app icons. There is a checkbox in the asset catalog Attributes Inspector that should be checked:
请注意,以防有人在使用 Xcode 5.0 和应用程序图标的资产目录时遇到同样的问题。资产目录属性检查器中有一个复选框应该被选中:
回答by ninjaneer
Check the info plist, it's different for the new XCode/iOS5.
检查信息 plist,新的 XCode/iOS5 是不同的。
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>[email protected]</string>
</array>
<key>UIPrerenderedIcon</key>
<true/> <--------------------------------here it is
</dict>
</dict>
回答by iwasrobbed
Muffle,
马弗,
I had this issue and it resolved after I deleted the app off the device. Not sure why yours won't.
我遇到了这个问题,并在我从设备上删除应用程序后解决了。不知道为什么你的不会。
Right click on the info.plist file in XCode and Open-As a plain text file. Make sure your text file reads like this in the area for the pre-rendered icon:
右键单击 XCode 中的 info.plist 文件并打开 - 作为纯文本文件。确保您的文本文件在预渲染图标的区域中是这样的:
<key>UIPrerenderedIcon</key>
<true/>
I also had a strange occurence (in another app) where the info.plist file I THOUGHT I was using was set correctly. Then I opened up the file directly in the mac Finder window and it turns out XCode was using the wrong info.plist file. That's a long shot in your case, but wouldn't hurt to give it a try for a quick sanity check.
我也有一个奇怪的事件(在另一个应用程序中),我认为我使用的 info.plist 文件设置正确。然后我直接在 mac Finder 窗口中打开文件,结果发现 XCode 使用了错误的 info.plist 文件。在您的情况下,这是一个长期的尝试,但尝试进行快速的健全性检查并没有什么坏处。
Hope that helps,
希望有所帮助,
Rob
抢
回答by Sandip Patel - SM
Yes this need two set at two places as described in above figure.
If you want to set value dynamically using command from shell script or terminal, you can do that as below:
/usr/libexec/PlistBuddy -c "Set :UIPrerenderedIcon YES" YOUR_PLIST_FILE_PATH
/usr/libexec/PlistBuddy -c "Set :CFBundleIcons:CFBundlePrimaryIcon:UIPrerenderedIcon YES" YOUR_PLIST_FILE_PATH
**NOTE:** [Fore being helpful to the developer who want to set this using command]
回答by Jakob W
I solved it by moving the "Icon already includes ..." up a row in the plist. My guess is that the parser doesn't handle empty tags very well in the end of the plist.
我通过在 plist 中将“图标已经包含...”向上移动一行来解决它。我的猜测是解析器在 plist 的末尾不能很好地处理空标签。
回答by Owen
I checked the plist read correctly and I moved it up a row, it still was not working.
我检查了正确读取的 plist 并将其向上移动了一行,它仍然无法正常工作。
My solution: Remove the app and then turn the iPad off and on.
我的解决方案:删除该应用程序,然后关闭再打开 iPad。
回答by Julio Del Valle
I set “Icon already includes gloss effects = YES” In the info.plist, search this part:
我在 info.plist 中设置了“Icon already includes gloss effects = YES”,搜索这部分:
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>myIcon.png</string>
</array>
</dict>
</dict>
Now, add this 2 lines:
现在,添加这 2 行:
<key>UIPrerenderedIcon</key>
<false/>
At the end, It must to be:
最后,它必须是:
<key>CFBundleIcons</key>
<dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>myIcon.png</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>