在splashScreen和主屏幕之间添加动画 [英] Adding animation between splashScreen And home screen

查看:39
本文介绍了在splashScreen和主屏幕之间添加动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个项目,在其中添加了初始屏幕,方法是在项目中添加default.png文件.

I have made a project in which i have added a splash screen by adding default.png file in the project.

问题是主屏幕出现在初始屏幕之后,但没有任何动画,我想在其中添加幻灯片效果.

the issue is the home home screen appears after the splash screen without any animation where as i want to add a slide effect.

那怎么办?

谢谢.

推荐答案

在您的-(BOOL)应用程序中:(UIApplication *)应用程序didFinishLaunchingWithOptions:(NSDictionary *)launchOptions :

 [window makeKeyAndVisible];
 splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,20, 320, 460)];//if you don't have the status bar set y=0 and height=480
 splashView.image = [UIImage imageNamed:@"Default.png"];
 [window addSubview:splashView];
 [window bringSubviewToFront:splashView];
 [UIView beginAnimations:nil context:nil];
 [UIView setAnimationDuration:0.8];
 [UIView setAnimationDelegate:self]; 
 [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
 //slide to left
 splashView.frame = CGRectMake(-320, 20, 320, 460);
 [UIView commitAnimations];

这篇关于在splashScreen和主屏幕之间添加动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆