Majster
Majster

Reputation: 3701

device selecting wrong retina image

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 [email protected] and the third one is [email protected]. 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?

Upvotes: 2

Views: 183

Answers (1)

pre
pre

Reputation: 3506

You need to handle this yourself. Using the suffix -586h@2x only works for the launch image.

Upvotes: 4

Related Questions