Wednesday, 28 August 2013

UIImage name in xibs issue: should I use @2x

UIImage name in xibs issue: should I use @2x

For instance I have image great_image.png and great_image@2x.png for
retina display. If I want to create UIImage in code I just write:
UIImage *image = [UIImage imageNamed:@"great_image"];
But if I create UIImageView in xib and I want to set image in xib, I need
to write image name. What should I write: "great_image.png" or
"great_image@2x.png" or "great_image" ? (because if I write "great_image",
I will not see image in xib).
Update: the second part of question:
What if I only have great_image@2x.png and don't have great_image.png,
should I write great_image.png in xib anyway?

No comments:

Post a Comment