UIView自带动画--UIViewAnimation

1.最简单的UIViewAnimation使用方法:    特点:基础,使用方便,但是效果有限
使用示例:
UIView *temp = [self viewWithTag:(NSInteger)(loadNumber +1000)]; 
[UIView beginAnimations:nil context:nil];
 [UIView setAnimationDuration:0.3];
 [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; temp.alpha = 1; 
[UIView commitAnimations];
 
其中transition取值范围
typedef enum {
UIViewAnimationTransitionNone,
UIViewAnimationTransitionFlipFromLeft,
UIViewAnimationTransitionFlipFromRight,
UIViewAnimationTransitionCurlUp,
UIViewAnimationTransitionCurlDown,
} UIViewAnimationTransition;
 
2、使用UIView类的UIViewAnimationWithBlocks扩展:
特点:快捷方便,效果更多.可以如上示例1那样实现界面个元素属性渐进变化的动态展示
使用示例:
 [UIView animateWithDuration:0.3 animations:^{
        [temp setFrame:LEFTBIGIMAGEFRAME];
    } completion:^(BOOL finish){     
}];

 

 

 

posted @ 2012-11-14 19:33  小、  阅读(2225)  评论(1编辑  收藏  举报