I have to display the same image in iPhone and iPhone(3.5 retina inch). But it appears differently.
The original image looks like this:

It runs correctly in iPhone but it doesn't run correctly in iPhone(3.5 retina inch). In iPhone(3.5 retina inch), it appears like this:

I have tried this:
imageView.contentMode = UIViewContentModeScaleToFill;
The whole code looks like this:
if(IS_IPHONE_5)
{
// code for 4-inch screen
backgroundImageView.frame = CGRectMake(0, 0, 320, 460);
backgroundImageView.image = [UIImage imageNamed:@"image1_iphone5.png"];
} else {
// code for 3.5-inch screen
backgroundImageView.frame = CGRectMake(0, 0, 320, 370);
backgroundImageView.contentMode = UIViewContentModeScaleToFill;
[backgroundImageView setImage:[UIImage imageNamed:@"image1.png"]];
}
but this doesn't solve the problem. Have been stuck with this issue for a day. Not sure what the problem is. Really need some guidance.
drawRectmethod and use[img drawInRect:rect];to draw the image. - kaar3k