码迷,mamicode.com
首页 > 其他好文 > 详细

启动页面动画

时间:2015-09-11 12:07:43      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:

在你的应用代理中找到application didFinishLaunching,添加以下代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];

//圖片擴大淡出的效果开始;

//设置一个图片;
UIImageView *niceView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
niceView.image = [UIImage imageNamed:@"Default.png"];

//添加到场景
[self.window addSubview:niceView];

//放到最顶层;
[self.window bringSubviewToFront:niceView];

//开始设置动画;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
[UIView setAnimationDelegate:self];
//這裡還可以設置回調函數;

//[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];

niceView.alpha = 0.0;
niceView.frame = CGRectMake(-60, -85, 440, 635);
[UIView commitAnimations];
[niceView release];

//结束;

启动页面动画

标签:

原文地址:http://www.cnblogs.com/linximu/p/4800132.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!