在目前的项目中,需要一个滚动效果,类似于下图这种沿着虚线一直运动的小球~
查了很多资料,但是普遍给出的答案都是一条线按照特定轨道运行而不是一个物体可以按照特定轨道运行.
所以自己想了办法,就是使用SDK中自带的 CAKeyframeAnimation 类来为物体指定运行轨迹,运行时间,重复次数等信息。
1)CAKeyframeAnimation
文档上对这个类的解释为:
The CAKeyframeAnimation class provides keyframe animation capabilities for a layer object. You create an CAKeyframeAnimation object using the inherited animationWithKeyPath: method, specifying the key path of the property that you want to animate on the layer. You can then specify the keyframe values to use to control the timing and anima |