所以我知道 Default.png 可以用于 iPhone 应用程序中的启动画面,但我发现它看起来不专业,因为一旦应用程序完成加载就没有动画。
所以我正在尝试添加一个会淡出的启动画面,然后转到上一个视图。
互联网上的大多数示例往往基于使用 addSubview 的旧方式。我将如何将其添加到我的故事板应用程序中。
当前代码(时间错误,因为我不确定它最初是否有效)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
splashView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default2.png"]];
splashView.frame = CGRectMake(0, 0, 324, 480);
[_window addSubview:splashView];
[_window bringSubviewToFront:splashView];
[_window makeKeyAndVisible];
[self performSelector:@selector(removeSplash) withObject:nil afterDelay:1500.2];
return YES;
}
-(void)removeSplash;
{
[UIView animateWithDuration:1.0 animations:^{self.splashView.alpha = 0.0;} completion:^(BOOL finished){ [splashView removeFromSuperview]; }];
[splashScreen release];
}