Pulling animation on ios

ε祈祈猫儿з 提交于 2019-12-12 02:56:43

问题


Please i need to know how can i do pulling effect using multiple image.

Those images must follow a specific path each image beside another one like a train.

is there any solution than looping.

what i wanna exactly is those image move simultaneously.


回答1:


You want to use a CAKeyFrameAnimation, using a CGPath to describe the path you want your objects to follow.

You would create a series of animations, each using the same path, but with different beginTimes. The tricky bit is how to use beginTime. You want to set each animation to a time in the future using code like this:

anAnimation.beginTime = CACurrentMediaTime()+delay;

When an animation is part of a group, beginTime is expressed as a number of seconds from the start of the group animation. You can't group animations on different layers, though, so you need to start each animation independently. To do that, you set beginTime to a time starting from CACurrentMediaTime().



来源:https://stackoverflow.com/questions/10295712/pulling-animation-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!