У меня есть этот код, который должен создать всплеск изображения без анимации или постепенного появления, затем вызвать код, чтобы отклонить изображение после задержки. SplashViewAnimationNone
отлично работает и создает полноэкранное изображение, но код Fade затемняет изображение, но затем сразу исчезает.
- (void)startSplash {
[[[[UIApplication sharedApplication] windows] objectAtIndex:0] addSubview:self];
splashImage = [[UIImageView alloc] initWithImage:self.image];
if (self.animationIn == SplashViewAnimationNone)
{
[self addSubview:splashImage];
}
else if (self.animationIn == SplashViewAnimationFade)
{
[self addSubview:splashImage];
CABasicAnimation *animSplash = [CABasicAnimation animationWithKeyPath:@"opacity"];
animSplash.duration = self.animationDelay;
animSplash.removedOnCompletion = NO;
animSplash.fillMode = kCAFillModeForwards;
animSplash.fromValue = [NSNumber numberWithFloat:0.0];
animSplash.toValue = [NSNumber numberWithFloat:1.0];
animSplash.delegate = self;
[self.layer addAnimation:animSplash forKey:@"animateOpacity"];
}
// Dismiss after delay.
[self performSelector:@selector(dismissSplash) withObject:self afterDelay:self.delay];
}