Android 过渡动画
我想要一个动画 gif,因为这在 Android 中是不可能的,所以我在过渡中使用单独的帧。
除了看起来过渡类只会显示两帧!我看到了其他动画方法,但它们似乎不适用于我正在做的事情,或者看起来像年长的婴儿 android 版本一样陈旧和复杂
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/activateanima"></item>
<item android:drawable="@drawable/activateanimb"></item>
<item android:drawable="@drawable/activateanimc"></item>
<item android:drawable="@drawable/activateanimc"></item>
<item android:drawable="@drawable/activateanimd"></item>
<item android:drawable="@drawable/activateanime"></item>
<item android:drawable="@drawable/activateanimf"></item>
<item android:drawable="@drawable/activateanimg"></item>
</transition>
如何使图像动画化,使其表现得像动画 gif 一样。这里没有旋转或平移。使用安卓2.1+
I want an animated gif, since this isn't possible in Android I am using individual frames in a transition.
except it seems like the transition class only will show two frames ever! I saw other animation methods but they didn't seem to apply to what I was doing, or seemed old and convulated like for an older infant android build
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/activateanima"></item>
<item android:drawable="@drawable/activateanimb"></item>
<item android:drawable="@drawable/activateanimc"></item>
<item android:drawable="@drawable/activateanimc"></item>
<item android:drawable="@drawable/activateanimd"></item>
<item android:drawable="@drawable/activateanime"></item>
<item android:drawable="@drawable/activateanimf"></item>
<item android:drawable="@drawable/activateanimg"></item>
</transition>
How do I animate an image to behave like an animated gif, in place. no rotations or translations here. Using android 2.1+
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您想要
帧动画
吗?请参阅:此处。这将播放静止动画。上述站点的示例:
保存在 res/anim/rocket.xml 的 XML 文件:
要使用:
Are you after a
Frame animation
? See: here. This will play a standing still animation.Example from above site:
XML file saved at res/anim/rocket.xml:
To use:
只需使用视图翻转器即可在图像之间翻转。只需将您的进出动画定义为 0 秒长,它们就应该是瞬时的。 (但请使用 alpha 来确定)。视图翻转器还具有自动动画和自动启动的优点
Just use a view flipper to flip between the images. Just define your in and out animations to be 0seconds long and they should be instantianous. (but use alpha to be sure). View flipper has the benefit of also auto animating and auto starting