【发布时间】:2013-05-14 15:17:31
【问题描述】:
我想以非阻塞方式对 UIView 及其所有内容进行动画缩放。目前我这样做...
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.1];
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
CGAffineTransform transform = CGAffineTransformMakeScale(1.1,1.1);
self.view.transform = transform;
[UIView commitAnimations];
但是它是阻止。我宁愿使用类似 ...
[UIView animateWithDuration:0.2
animations:^{
CGAffineTransform transform = CGAffineTransformMakeScale(1.1,1.1);
self.view.transform = transform;
}];
... 但 animateWithDuration 不适用于 CALayer/CGAffineTransform 转换。如何在不阻塞任何东西的情况下实现相同的动画?
【问题讨论】:
-
也许只是手动更改视图框架的大小和原点,而不是使用转换,更方便的工作,但它应该工作
标签: ios objective-c animation block calayer