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上沿路径动画图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在Android上沿路径动画图像?


- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- android 4中的android RadioButton问题 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01