Reputation: 19969
I am using an icon in a NSAttributedString via the following:
NSTextAttachment *textAttachment = [[NSTextAttachment alloc] init];
textAttachment.image = [UIImage imageNamed:@"notes-18w_18h.png"];
NSAttributedString *attrStringWithImage = [NSAttributedString attributedStringWithAttachment:textAttachment];
[headerAS replaceCharactersInRange:NSMakeRange([headerAS length], 0) withString:@" "];
[headerAS replaceCharactersInRange:NSMakeRange([headerAS length], 0) withAttributedString:attrStringWithImage];
It looks like their is some pixelation but I'm not 100% sure as this is the first time I've used an icon via NSAttributedString. It looks like this:
and the original icon looks like this:
Does this look ok? Or is there something I should be doing to my icon to improve the resolution?
Upvotes: 2
Views: 187
Reputation: 364
Make sure you have a retina version of the icon also in the bundle. @2x
Upvotes: 2