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上沿路径动画图像?
基础教程推荐
- AdMob 广告未在模拟器中显示 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
