I have a problem with displaying a background image on the iPhone 5. I have added 3 images to the project. First one is named main_background.png
second one is main_background@2x.png
and the third one is main_background-586h@2x.png
. In the init method I assigned the image to the background like this:
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self)
{
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"main_background"]];
}
return self;
}
I ran the application on my iPhone 5 and it picked the @2x image. It started repeating it on the y axis. What am I doing wrong and how to fix this?