- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window.rootViewController.view.alpha = 0;
_splashImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Default"]];
_splashImageView.frame = [UIScreen mainScreen].bounds;
[self.window addSubview:_splashImageView];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.5 animations:^{
self.window.rootViewController.view.alpha = 1.0;
} completion:^(BOOL finished) {
[_splashImageView removeFromSuperview];
}];
});
return YES;
}
自定义图片加载,延时时间,以及动画收回时间。

本文介绍了一个简单的iOS应用启动屏幕实现方案。通过自定义图片加载、设置延时显示时间和动画效果来展示启动画面,并在指定时间后平滑过渡到应用主界面。
1093

被折叠的 条评论
为什么被折叠?



