January 8th, 2012, 04:26 AM
|
#1 (permalink)
|
|
New Member
Join Date: Jan 2012
Posts: 3
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
|
Animation for button does'nt working
Hello,
I try add animation for button, I try use own, xml file
Quote:
<animation-list android neshot="false" xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
<item android:drawable="@drawable/cat" android:duration="200" />
<item android:drawable="@drawable/catakt" android:duration="200" />
</animation-list>
|
saved as catanim.xml
and use as setBackgroundResource(R.drawable.catanim);
That doesn't work
I try also code like here
Quote:
animation = new AnimationDrawable();
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.cat), 3000);
animation.addFrame(getResources().getDrawable(R.dr awable.catakt), 3000);
animation.setOneShot(false);
animal1Button.setBackgroundDrawable(animation);
animation.setVisible(true, true);
animation.start();
|
And animation for button still doean't work on Emulator and Device (both with Android 2.1 / API 7)
Please help
|
|
|