How to addapt iphone background?

2019-09-04 22:49发布

问题:

I am new to developing and I am trying to find how to have a different background image for different iphones (4s 5 5s ect...) I did manage to have a background image but its the same in all simulators so it only fits the Iphone 6 plus any ideas on how I could do this?

thank you

回答1:

If you use xcassets for your ressources :

If you don't you can add one :

You can add your images in an image set specific to devices like below :

You just have to configure the right panel accordingly (selecting device specific and choosing all that you need) :

One drawback : The .jpg support seems to not be compatible with iOS7. Big images in png are... big.



标签: ios xcode