开发者

can you cache a view using animation blocks

Is there an equivalent way of doing this using animation blocks

[UIView setAnimationTransition:<some开发者_运维问答_transition> forView:<view> cache:YES];

this seemed to be handy way of not getting staggered animations or to make animations smooth so it doesn't keep redrawing every so often. But i can't seem to figure out how to do this with animation blocks. Maybe i've just missed something somewhere.


Look at the block based methods for transitions: +[UIView transitionFromView:toView:duration:options:completion:] and +[UIView transitionWithView:duration:options:animations:completion:].

The views are by default cached when you use these block based methods. You turn caching of using the UIViewAnimationOptionAllowAnimatedContent option.


The option only makes sense for transitions. Most animations that you'd use an animation block for couldn't make use of a rasterized cache of just one entire view, because they involve multiple views that move relative to one another and must be composited in every frame of the animation.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜