Animate image along path on Android?(在Android上沿路径动画图像?)
问题描述
可能重复:
Android,沿路径移动位图?
有没有办法像 iPhone 上的 CGPath 一样在 Android 上沿路径设置 ImageView 的位置?我已经在网上搜索了这个问题的解决方案,但似乎没有人问过这个问题.我在 Android 文档中没有看到任何描述此功能的内容.
Is there a way to animate an ImageView's position along a path on the Android as with a CGPath on the iPhone? I have scoured the web for a solution to this, but no one has even seemed to ask about it. I didn't see anything in the Android docs describing this functionality.
推荐答案
我创建了一个名为 PathAnimation 的 Animation 子类,它可以沿路径设置动画.
I created a subclass of Animation named PathAnimation, which can animate along a path.
您可以使用 Path 创建一个新的 PathAnimation,并像使用任何其他动画一样使用它.
You can just create a new PathAnimation with a Path, and use it like any other Animations.
https://github.com/coocood/PathAnimation
这篇关于在Android上沿路径动画图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!