简体   繁体   中英

iOS Image Asset sizing. Is 3x actually 3 times the 1x size and is Retina 4 2x required?

I'm trying to wrap my head around everything and to make sure I do everything properly.

I've been looking at The Ultimate Guide to iPhone Resolutions and want clarification on 3x and Retina 4 2x.

For 3x, apparently the images get downsampled. I shouldn't care about that, right? All I need to do is put an image whose width and whose height is 3 times greater than that of the 1x image. Of course, with the intent that I'm scaling the image. So it follows the same exact step from 1x to 2x in that I just make the size larger. Is that correct?

Then, I see the iPhone 5 and iPhone 5s which I think both use Retina 4 2x. Is Retina 4 2x required? If not, it just defaults to 2x, right? What differences should there be between the Retina 4 2x and the 2x image? How would I scale the width and height differently?

You're getting a little confused. There is just the normal, @2x and @3x. There is no "retina 2x".

imageName.png 60 x 60 imageName@2x.png 120 x 120 imageName@3x.png 180 x 180

Your code will be: image = [UIImage imageNamed:@"imageName"]; and iOS will do the rest for you. Same goes if you're using interface builder. Just put in the standard image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM