Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<ol> <li>Setup frame for imageView, otherwise it has the same sizes as an image</li> <li>Setup correct contentMode</li> <li>Try to use self.window, instead of [navigationController view]</li> </ol> <p>Example:</p> <pre><code>UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"IMG_1357.png"]]; imageView.contentMode = UIViewContentModeScaleAspectFill; imageView.frame = self.window.bounds; [self.window addSubview:imageView]; [imageView release]; [self.window makeKeyAndVisible]; //now fade out splash image [UIView transitionWithView:self.window duration:4.0f options:UIViewAnimationOptionTransitionNone animations:^(void) { imageView.alpha = 0.0f; } completion:^(BOOL finished ){ [imageView removeFromSuperview]; }]; </code></pre> <p>To add a 1 second pause before the fade out:</p> <pre><code>int64_t delayInSeconds = 1.0; dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ [UIView transitionWithView:self.window duration:4.0f options:UIViewAnimationOptionTransitionNone animations:^(void) { imageView.alpha=0.0f; } completion:^(BOOL finished ){ [imageView removeFromSuperview]; }]; }); </code></pre> <p>or</p> <pre><code>[self performSelector:@selector(_hideSplash:) withObject:imageView afterDelay:1.0]; - (void) _hideSplash:(UIView *)view { [UIView transitionWithView:self.window duration:4.0f options:UIViewAnimationOptionTransitionNone animations:^(void) { view.alpha=0.0f; } completion:^(BOOL finished ){ [view removeFromSuperview]; }]; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload