这样做UIView的动画

  1. // Hide the bar button and show the view  
  2. self.navigationItem.rightBarButtonItem = nil;  
  3. [self.view viewWithTag:101].alpha = 1.0f;  
  4.   
  5. // Bounce to 115% of the normal size  
  6. [UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];  
  7. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
  8. [UIView setAnimationDuration:0.4f];  
  9. [self.view viewWithTag:101].transform = CGAffineTransformMakeScale(1.15f, 1.15f);  
  10. [UIView commitModalAnimations];  
  11.   
  12. // Return back to 100%  
  13. [UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];  
  14. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
  15. [UIView setAnimationDuration:0.3f];  
  16. [self.view viewWithTag:101].transform = CGAffineTransformMakeScale(1.0f, 1.0f);  
  17. [UIView commitModalAnimations];  
  18.   
  19. // Pause for a second and appreciate the presentation  
  20. [NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:1.0f]];  
  21.   
  22. // Slowly zoom back down and hide the view  
  23. [UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];  
  24. [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];  
  25. [UIView setAnimationDuration:1.0f];  
  26. [self.view viewWithTag:101].transform = CGAffineTransformMakeScale(0.01f, 0.01f);  
  27. [UIView commitModalAnimations];  
  28.   
  29. // Restore the bar button  
  30. [self.view viewWithTag:101].alpha = 0.0f; 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值