UIView的简单的动画效果

这里介绍一下 UIView的简单的动画效果 

//动画块
    [UIView beginAnimations:nil context:nil];
    //时间
    [UIView setAnimationDuration:10.0];
    //动画效果
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:NO];
    //减速效果
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationWillStartSelector:@selector(animationWillStart)];
    [UIView setAnimationDidStopSelector:@selector(animationWillStop)];
    
    ////下面是自己要做的事情 这里交换一下两个UIView的位置
    [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
    
    [UIView commitAnimations];

- (void)animationWillStart{
    NSLog(@"动画 开始");
}

- (void)animationWillStop{
    NSLog(@"动画结束");
}

 ////////////////渐变消失
        UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-100)];
        splashView.image = [UIImage imageNamed:@"222"];
        NSURL *url = [NSURL URLWithString:str];
        [splashView setImageWithURL:url];
        [self.window addSubview:splashView];
        [self.window bringSubviewToFront:splashView];
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:3.0];
        [UIView setAnimationTransition:UIViewAnimationTransitionNone forView:
         self.window cache:YES];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(startupAnimationDone)];
        splashView.alpha = 0.0;
        splashView.frame = CGRectMake(-60, -85, 440, 635);
        [UIView commitAnimations];


你可能感兴趣的:(UIView的简单的动画效果)