- -(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
- {
- self.window=[[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];
- //Overridepointforcustomizationafterapplicationlaunch.
- self.viewController=[[[ViewControlleralloc]initWithNibName:@"ViewController"bundle:nil]autorelease];
- self.window.rootViewController=self.viewController;
- [self.windowmakeKeyAndVisible];
- UIImageView*splashScreen=[[[UIImageViewalloc]initWithFrame:self.window.bounds]autorelease];
- splashScreen.image=[UIImageimageNamed:@"Default"];
- [self.windowaddSubview:splashScreen];
- [NSThread sleepForTimeInterval:10.0];
- [UIViewanimateWithDuration:1.0animations:^{
- CATransform3Dtransform=CATransform3DMakeScale(1.5,1.5,1.0);
- splashScreen.layer.transform=transform;
- splashScreen.alpha=0.0;
- }completion:^(BOOLfinished){
- [splashScreenremoveFromSuperview];
- }];
- returnYES;
- }
- -(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions
- {
- self.window=[[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];
- //Overridepointforcustomizationafterapplicationlaunch.
- self.viewController=[[[ViewControlleralloc]initWithNibName:@"ViewController"bundle:nil]autorelease];
- self.window.rootViewController=self.viewController;
- [self.windowmakeKeyAndVisible];
- UIImageView*splashScreen=[[[UIImageViewalloc]initWithFrame:self.window.bounds]autorelease];
- splashScreen.image=[UIImageimageNamed:@"Default"];
- [self.windowaddSubview:splashScreen];
- [NSThread sleepForTimeInterval:10.0];
- [UIViewanimateWithDuration:1.0animations:^{
- CATransform3Dtransform=CATransform3DMakeScale(1.5,1.5,1.0);
- splashScreen.layer.transform=transform;
- splashScreen.alpha=0.0;
- }completion:^(BOOLfinished){
- [splashScreenremoveFromSuperview];
- }];
- returnYES;
- }
本文介绍了一种在iOS应用中实现启动屏幕动画效果的方法。通过使用Objective-C编程语言,文章详细展示了如何创建一个UIView动画来缩放并逐渐淡出启动图片。
2103

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



