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){     
}];

 

 

 

相关文章:

  • 2021-11-29
  • 2022-12-23
  • 2021-10-01
  • 2022-12-23
  • 2021-11-29
  • 2021-09-07
  • 2021-08-31
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-11-15
  • 2021-04-19
相关资源
相似解决方案