ios - change size of UIImage imageNamed -
i have retina image want display @ 1/2 of resolution. there command can use display image @ 46px x 40px instead of 91px x 80px?
code in xcode:
annview.image = [uiimage imagenamed:@"app_green@2x.png"];
annview.image = [uiimage imagenamed:@"app_green"];
on retina device, double-resolution version of image (i.e. 1 @2x
suffix in name) used automatically @ size of single-resolution image.
even better, use asset catalog. don't have worry name of double-resolution image; slot catalog.
Comments
Post a Comment