I’m trying to set the size of a UIImageView programmatically using:
[thisImageView setFrame:CGRectMake(x, y, image.size.width, image.size.height)];
I tried using x = 0, y = 0, but the UIImageView disappears.
More info on why I’m trying to do this. I’m trying to display a high-res image on an iPhone 4 without using the iOS 4 SDK (only using 3.2 SDK API calls). I have calls to see if I’m on an iPhone 4, so I’m trying to double the size of my UIImageView so that when I put the high-res UIImage in, it won’t be grainy.
Not sure what there is so special about iOS. Just use the same method you use with 3.2: imageNamed: … it will take care of everything as long as your images are named properly (yourimagename.png and yourimagename@2x.png). Nothing fancy in the iOS 4 SDK here, just give the size you use in points as before.
If this is not suitable in your case, can you explain why?