问题
I have something strange in my app.
If in the ressources I have 2 files named : myFile~ipad.png and myFile@2x~ipad.png the retina image is loaded on iPad retina as it should be. But If i have two files named myFile.png and myFile@2x~ipad.png, the retina images is never loaded and myFiles.png is used for all devices.
Is this normal ? The problem is that I want to use the image myFile.png for iPhone, iPhone retina and iPad and the image myFile@2x~ipad.png for iPad retina so I can't put the extension ~ipad beyond myFile.png.
回答1:
Use symlink. I just google it, and didn't say it couldn't be done, but most of it points to symlink in an SD card.
回答2:
You can have the same image "myFile.png" with different name as myFile~ipad.png so that you can have same result for iPhone, iPhone retina and iPad. And "myFile@2x~ipad.png" image for ipad retina display.
hope this will help.
回答3:
We tried using symlinks, but it turns out that in the built app, the symlinks actually turned into copies of the images they linked to. Xcode resolves symlinks by copying the source file. So you can use symlinks for convenience, but not to save storage space in the built app.
来源:https://stackoverflow.com/questions/9923559/retina-images-2xipad-not-loaded-if-ipad-image-doesnt-exist-ipad