iPhone 开发中关于 UIView Animation 实现效果
iPhone 开发中关于 UIView Animation 实现效果是本文要介绍的内容,主要是来学
习 UIView Animation 一连串的实现效果,具体内容我们来看本文如何实现。之前受某人
影响以为一连串的 UIView Animation 只能这么写:
在某个 animation 设置 delegate ,然后在 delegate 函数中再调用另一个函数。
今天偷闲决定看 iPhone cookbook 代码查漏补缺下,结果发现这代码:
C 代码
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.
找软件资料,就到一览软件文库