So I'm building an app that uses images for buttons. I provided both normal images and @2x images, however I'm not totaly sure which one I should use. There is basicly no diffrence if I use normal.png or [email protected]. However I've read that using @2x takes more memory, so I feel like I shouldn't do it. However, when I start my app in the iPad simulator, it looks bad when using normal size images, because it needs to resize them. When I use the @2x image, it looks normal. So any suggestions on how I should approach this?
You should include images both with .png
and @2x.png
within your application to support retina devices. This provides a nice user experience for your user.
Throughout your code, you do not explicitly specify the @2x
suffix, as the OS will take care of that for you. For example, if you include image.png
and [email protected]
in your project, and access it via:
UIImage* image = [UIImage imageNamed:@"image"];
The OS will select the correct image for you (.png
for non retina devices, @2x.png
for retina devices). You don't need to worry about the memory usage difference for each one, as long as you follow general memory management guidelines.
You should:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With