很简单在加载完window初始化了nav以及tabar之后,也就是
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions ;
这个方法的最后,去调用以下方法。是不是很简单诺。
- (void)splashViewShow{
self.splashView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
[_splashView setImage:[UIImage imageNamed:@"640-1136"]];
if (kScreenHeight == 568) { // 4inch
[_splashView setImage:[UIImage imageNamed:@"640-1136"]];
} else if (kScreenHeight == 667) { // 4.7inch
[_splashView setImage:[UIImage imageNamed:@"750-1334"]];
} else if (kScreenHeight == 736) { // 5.5inch
[_splashView setImage:[UIImage imageNamed:@"1242-2208"]];
} else { // 3.5inch
[_splashView setImage:[UIImage imageNamed:@"640-960"]];
}
[self.window addSubview:_splashView];
[self.window bringSubviewToFront:_splashView];
[UIView animateWithDuration:3.0f animations:^{
_splashView.alpha=0.0f;
self.splashView.frame = CGRectMake(- kScreenWidth/2, - kScreenHeight/2, kScreenWidth*2, kScreenHeight*2);
} completion:^(BOOL finished) {
[_splashView removeFromSuperview];
}];
}