I want to set the background image of a view. I use three images: backgroundimage.png (size 320 x 480), [email protected] (size 640 x 960) and [email protected] (size 640 x 1136)
that works for iphone 3g size. But when I test it for retina size the background image is just a small part of the original image. I think, that I have to downscale the image somehow, or set a frame for it, but I just don't know how.
Thanks for any help ;)
thats the code:
self.view.backgroundColor = [UIColor clearColor];
UIImage *backgroundImage = [[UIImage alloc]init];
if ([[UIScreen mainScreen] bounds].size.height == 568) {
backgroundImage = [UIImage imageNamed:@"background-568h@2x"];
}
else{
backgroundImage = [UIImage imageNamed:@"background"];
}
self.view.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];