问题
I have some image files for iPhone 5 size 640x1136, i have previously implemented retina images for iPhone 4 & 4S using @2x suffix, so what will be the suffix for images in iPhone 5, we can user the same as is @2x or it has to be changed.
回答1:
See my answer here. Some useful macros to help you with dealing with images.
回答2:
It’ll still use @2x
images where they’re available. There’s a -568h
suffix you can use for the launch image, as in Default-568h@2x.png
, but that’s currently the only place it’s supported; see Leo’s answer for a way to get that working elsewhere.
回答3:
For the iPhone Retina 4-inch (iPhone 5) it's still the @2x
suffix because the density is the same as the iPhone Retina (iPhone 4 and 4S). The screen is bigger but have the same density.
The -568h suffix will work only in for the default image because it's the only place you really need it (just to tell the system that your app have been optimized for this new screen size, and it can stretch your views).
The naming convention Default-xxx.png
is just here to provide the right image while the app is launching but I think it's non sense to try to replicate the same to load other images in imageViews. It's like the Default-(landscape|portrait).png
on iPad. You never need this convention to load images yourself.
The only rule is:
@
is for density (2 density exist right now, normal and 2x)~
is for device (2 different devices exist right now, iphone and ipad)
To adapt images/imageView on the 4-inch iPhone you should play with your imageView content mode and the autoresizing configurations.
来源:https://stackoverflow.com/questions/12517646/suffix-for-retina-images-in-iphone-5