IOS动画

[UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^(void) {
            
        }completion:^(BOOL finished) {
            
        }];

要注意, 使用 颜色, 尺寸, 位置动画, 必须要有初始值, 不然不会有动画效果

 

例如颜色

 _bgView.backgroundColor = [UIColor clearColor];

[UIView animateWithDuration:0.4 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^(void) {

 

        _bgView.backgroundColor = [UIColor redColor];

    }completion:^(BOOL finished) {

        

    }];

 

如果不加上

_bgView.backgroundColor = [UIColor clearColor];
是不会有效果的
posted @ 2014-10-23 16:17  apem  阅读(121)  评论(0编辑  收藏  举报