模拟系统 Launchimage 启动页效果,通过 Image 和 UIWindow 组合并添加动画的方式,具体实现如下所示;
/// 模拟 launchimage 启动页
- (void)setupStartupPage {
UIImageView *imgView = [[UIImageView alloc] initWithFrame:self.window.bounds];
[imgView setImage:[[UIImage imageNamed:@"splash_bg_iOS"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
[self.window addSubview:imgView];
[self.window bringSubviewToFront:imgView];
imgView.alpha = 0.99;
[UIView animateWithDuration:3.f delay:0.f options:UIViewAnimationOptionTransitionNone animations:^{
imgView.alpha = 1;
} completion:^(BOOL finished) {
[imgView removeFromSuperview];
}];
}
以上便是此次分享的全部内容,希望能对大家有所帮助!
网友评论