在android应用程序中设计和嵌入动画的最佳方法是什么?(我不是在谈论动画中的转换和活动。)
我能想到两种方法:
。
这其中哪一个更好/最常见?以及如何实现解决方案(如果有更好的解决方案--这将是很棒的)。您通常使用哪些程序来完成这类任务?
(目标是实现像青蛙在切断绳子,鸟类在愤怒的鸟,例如)
谢谢!
发布于 2012-01-19 14:24:25
我在一个项目中使用了简单的动画..。这是你的第一点。/res/ *.png中的一系列*.xml文件,类似于:
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="true">
<item android:drawable="@drawable/s250" android:duration="200" />
<item android:drawable="@drawable/s251" android:duration="200" />
<item android:drawable="@drawable/s252" android:duration="200" />
<item android:drawable="@drawable/s253" android:duration="200" />
<item android:drawable="@drawable/s254" android:duration="200" />
<item android:drawable="@drawable/s255" android:duration="200" />
<item android:drawable="@drawable/s256" android:duration="200" />
<item android:drawable="@drawable/s257" android:duration="200" />
<item android:drawable="@drawable/s258" android:duration="200" />
</animation-list>..。还有源头..。
final ImageView pygalo = (ImageView) findViewById(R.id.imageanimation);
pygalo.setBackgroundResource(R.anim.animation);
final AnimationDrawable pygaloanimation = (AnimationDrawable) pygalo.getBackground();
pygalo.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View vp) {
pygaloanimation.stop();
pygaloanimation.start();
}
});做起来很容易..。
https://stackoverflow.com/questions/8927259
复制相似问题