ZhouQi
ZhouQi

Reputation: 531

how to make resizable image with @2x file?

My code:

self.commentTextViewBorder.image = [[UIImage imageNamed:@"border_comment_field"]
resizableImageWithCapInsets:UIEdgeInsetsMake(11, 11, 11, 11)];

I found it did not user @2x image file to make resiable. Is it any problem?

Upvotes: 2

Views: 383

Answers (1)

Kjuly
Kjuly

Reputation: 35131

Put your image_name.png & [email protected] at your main bundle folder, and just use

[UIImage imageNamed:@"image_name.png"];

is fine. The correct one will be used automatically depend on the devices w/ or w/o retina display.

Upvotes: 6

Related Questions