Image Size This is the resolution.
Your problem may be retinal imaging!
Check the Retina display and therefore make the UIImageView half the width / height (so that each UIImageView pixel will consist of four smaller UIImage pixels to display the retina).
How to check retinal display:
stack overflow
How to check image size (without actually loading the image into memory):
NSString *mFullPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"imageName.png"]; NSURL *imageFileURL = [NSURL fileURLWithPath:mFullPath]; CGImageSourceRef imageSource = CGImageSourceCreateWithURL((CFURLRef)imageFileURL, NULL); if (imageSource == NULL) {
So - for example:
UIImageView *mImgView = [[UIImageView alloc] init]; [mImgView setImage:[UIImage imageNamed:@"imageName.png"]]; [[self view] addSubview:mImgView]; if ([UIScreen instancesRespondToSelector:@selector(scale)]) { CGFloat scale = [[UIScreen mainScreen] scale]; if (scale > 1.0) {
Hope this helps!
Guntis treulands
source share