1

I am developing a small application and I am having problems with the images.

I have defined a xcassets with images for each device called LaunchImage.

It works ok.

The problem comes next, I want to keep that image 2 seconds regardless of what it takes to load the app .

For this I use the following code in the AppDelegate . Where I load again the same image for 2 seconds using an animation.

splashView= [[UIImageView alloc] initWithFrame:([[UIScreen mainScreen] bounds])];

    NSMutableArray *images = [[NSMutableArray alloc] init];

    [images addObject:[UIImage imageNamed:@"LaunchImage"]];

    [self.window addSubview:splashView];
    [self.window bringSubviewToFront:splashView];
    splashView.animationImages = images;
    splashView.animationDuration = 2;
    splashView.animationRepeatCount = 1;
    [splashView startAnimating];

Testing in iphone 6 I have noticed that it shows as switching from one image to another, because this is not recovering the same image from xcasset LaunchImage .

The splash screen is loading the imagen corresponding to size 750x1334 and the AppDelegate code the image corresponding to the size 640x960 .

Any idea why this might happen ?

Thanks

Kepa Santos
  • 557
  • 7
  • 21
  • Do you also have an image-file called LaunchImage? (`imageNamed:` looks for these) – Saa Sep 15 '15 at 15:50
  • No, I have only one xcassets called LaunchImage. In fact , I tested changing images of xcassets and I found that in fact, both loads are made from LaunchImage xcassets, but the first takes the 750x1334 image and the second the 640x960 image. – Kepa Santos Sep 15 '15 at 16:32

0 Answers0