开发者

Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device

开发者 https://www.devze.com 2023-01-02 04:55 出处:网络
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 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 ruini开发者_C百科ng my icon... Any thoughts?

Best Regards, Muffie


As Alex Stone said, in iOS 5 you have to edit it in 2 places.

Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device


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!


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:

Removing Shine/Gloss effect on the iPhone through UIPrerenderedIcon not working on device


Check the info plist, it's different for the new XCode/iOS5.

    <dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>Icon.png</string>
            <string>Icon@2x.png</string>
        </array>
        <key>UIPrerenderedIcon</key>
        <true/> <--------------------------------here it is
    </dict>
</dict>


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:

<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.

Hope that helps,

Rob


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]


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.


I checked the plist read correctly and I moved it up a row, it still was not working.

My solution: Remove the app and then turn the iPad off and on.


I set “Icon already includes gloss effects = YES” In the info.plist, search this part:

<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>myIcon.png</string>
        </array>
    </dict>
</dict>

Now, add this 2 lines:

       <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>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号