iOS UIView动画效果 学习笔记

 

//启动页动画
UIImageView *launchScreen = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
    launchScreen.image = [UIImage imageNamed:@"launchScreen"];
    [self.window addSubview:launchScreen];
    
    [UIView animateWithDuration:1.0f animations:^{
        launchScreen.alpha = 0;
//        CGRect frame = [UIScreen mainScreen].bounds;
//        frame.origin.x = frame.size.width;
//        launchScreen.frame = frame;
    }completion:^(BOOL isFinished){
        [launchScreen removeFromSuperview];
    }];

 

 

CGRect frame = _confirmV.frame;
    [UIView beginAnimations:nil context:nil];//动画定义开始
    [UIView setAnimationDuration:0.5];//动画的时长
    [UIView setAnimationDelay:0];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(removeConfirmView)];//动画完成时执行的SEL,必须设置delegate

    frame.origin.y += HEIGHT(self.view);//这三句就是要执行的动画语句
    targetView.frame = frame;
    targetView.alpha -= 0.1;

    [UIView commitAnimations];//动画定义结尾

 

 

详细可参考:http://www.tuicool.com/articles/BjMrQne

posted @ 2016-04-07 18:51  Ficow  阅读(157)  评论(0编辑  收藏  举报