Retina images (@2x~ipad) not loaded if iPad image

2019-06-01 17:52发布

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.

3条回答
叛逆
2楼-- · 2019-06-01 18:18

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楼-- · 2019-06-01 18:30

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.

查看更多
仙女界的扛把子
4楼-- · 2019-06-01 18:45

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.

查看更多
登录 后发表回答