iPhone上实现Default.png动画

原理:  

    1. 添加一张和Default.png一样的图片,对这个图片进行动画,从而实现Default动画的渐变消失的效果。  

操作:  

    1. 在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中添加如下代码:  

// Make this interesting.

    1.     UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];  

    splashView.image = [UIImage imageNamed:@"Default.png"];  

    1.     [self.window addSubview:splashView];  

    [self.window bringSubviewToFront:splashView];  

    1.     [UIView beginAnimations:nil context:nil];  

    [UIView setAnimationDuration:2.0];  

    1.     [UIView setAnimationTransition:UIViewAnimationTransitionNone forView: self.window cache:YES];  

    [UIView setAnimationDelegate:self];   

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

    splashView.alpha = 0.0;  

    1.     splashView.frame = CGRectMake(-60, -85, 440, 635);  

    [UIView commitAnimations];  

    1. 就ok了 
posted @ 2015-12-24 09:51  Bo-tree  阅读(105)  评论(0)    收藏  举报