开发者

How to find the co-ordinate of object which is in between of CAKeyframeAnimation?

开发者 https://www.devze.com 2023-03-01 05:46 出处:网络
Currently i am moving a png image using CAKeyframeAnimation along a path for 30 seconds. Is there any way to fi开发者_如何转开发nd the co-ordinate of imageview in between the animation? (lets say on 1

Currently i am moving a png image using CAKeyframeAnimation along a path for 30 seconds. Is there any way to fi开发者_如何转开发nd the co-ordinate of imageview in between the animation? (lets say on 15th second of animation)


Check presentationLayer in your imageview's layer - it contains all informations about layer's current state during animation. e.g. you can get current image center coordinates the following way:

CALayer *presLayer = [imageView.layer presentationLayer];
CGPoint currentCenter = presLayer.center;
0

精彩评论

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