问题
So I successfully completed my first iPhone release build and when I curiously went to "Show Package Contents" of the freshly-baked .app file, I noticed that all the contained PNGs are blank! They are all set to the appropriate resolutions, but when I open them, there's nothing to see but the default Preview.app grey.
I tried opening other .app "package contents" (from OS X apps) to see if their PNGs were visible and sure enough they were. So is this business as usual for an iPhone .app build or did I miss a gotcha?
回答1:
XCode may optimize pngs when building application - those files cannot be viewed in Preview app. See "Compress PNG Files" setting in your target (in Packaging block) - if it is set to YES then that's the case.
P.S. you can revert this optimization using pngcrush tool, see command-line command for that here
来源:https://stackoverflow.com/questions/5116106/show-package-contents-of-iphone-build-release-reveals-blank-pngs