开发者

Creating a custom animation with CGLayers?

Basically, I want to animate a shrinking circle. I've already done this by drawing progressively smaller circles onto CGLayer's, and then using

if(index < 30){

[self performSelector:@selector(showNextLayer) withObject:nil afterDelay:(NSTimeInterval)0.02]; index++;

}

in my showNextLayer method. This works for my simple goal, but in general is this a more or less sensible way to draw a custom animation?

Apple has a lot of documentation on animation -enough to confuse me-, but as far as I -finally- understand:

  1. The animation services provided by UIView is good for animating some basic view properties, view transitions etc.,
  2. those provided by classes that inherit from 开发者_运维问答CAAnimation, are good for animating properties like color change, 3d transformations etc.
  3. UIViewImage is good for animating custom bitmap images (and it is not a good idea to create bitmap images when you can just draw circles into a CGLayer instead).

It seems to me that displaying the contents of a sequence of CGLayer 's would also be supported, am I missing something?

Thanks in advance for any clarification..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜