Cannot display 640x1136 image on iphone5

I added the Default-568h@2x.png application image for my application. The application should display a second launch image after the "real" launch image. Since the UIImage imageNamed: method does not automatically load a higher image the way it automatically loads retina images, I added code to determine the screen size and display the correct image:

-(void)pickRightImage
{
    CGSize result = [[UIScreen mainScreen] bounds].size;
    UIImageView *imgv = [self loadingImage];

    UIImage *img;

    if(result.height == 480)
    {
        img = [UIImage imageNamed:@"loading_screen.png"];
    } else if([UIScreen mainScreen].scale == 2.f && result.height == 568) {
        // iPhone 5
       img = [UIImage imageNamed:@"loading_screen-568h@2x.png"];       
    }
    [imgv setImage:img];
}

ImageView NIB, MainWindow, "Full Screen At Launch". . ( .) , , .

4- iphone5? ?

0
2

. , " " > "" > " " > " " " ".

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIImageView *iv = [[UIImageView alloc] initWithFrame:self.view.bounds];
    iv.image = [UIImage imageNamed:@"Second-default568h@2x.png"];
    [self.view addSubview:iv];
}
+1

[UIImage imageNamed:] @2x .

img = [UIImage imageNamed:@"loading_screen-568h.png"];

4- , Retina ( = 2). 4- ( 568 ) Retina, , == 568, iPhone 5:

if ([UIScreen mainScreen].scale == 2.f && result.height == 568)

if ([UIScreen mainScreen].bounds.size.height == 568)

.

+4

All Articles