0
在下面UIView
动画块,我做了CGAffineTransformMakeScale
和CGAffineTransformMakeRotation
,而且虽然duration
设置为1.0f,
规模也快和旋转变为在1秒内像它应该。同一动画块中的两个属性更改具有不同的持续时间。为什么?
这一定是我对AffineTransforms
的应用缺乏理解,但我无法弄清楚。
什么给?
编辑:弗拉基米尔的答案效果很好。我改变了同一个属性两次,而不是改变两个属性。要对transform
属性进行两处更改,必须先制作一个transform
进行初始更改,然后将第二个更改添加到该transform
,然后从那里设置对象的transform
。这样,您可以根据需要将多个链接在一起。
CGColorRef color = [[colorArray objectAtIndex:colorIndex] CGColor];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0f];
[[self layer] setFillMode:kCAFillModeForwards];
[self setTransform:CGAffineTransformMakeScale(2.0, 2.0)];
[self setTransform:CGAffineTransformMakeRotation(M_PI/4)];
[[self layer] setBackgroundColor:color];
[UIView commitAnimations];
工程就像一个魅力。谢谢,弗拉基米尔!我觉得这是这样的... – Steve 2010-10-21 15:16:18