Java Android Studio中的PNG序列动画
所以我目前在oncreate中有这段代码。我真的很想创建一个动画,只要用户打开应用程序使用png序列Java Android Studio中的PNG序列动画,java,android,animation,Java,Android,Animation,所以我目前在oncreate中有这段代码。我真的很想创建一个动画,只要用户打开应用程序使用png序列 public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_home); view = (ImageView) findViewById(R.id.imageAnimation); view.setBackgroundResource(R.drawable.anima
public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_home);
view = (ImageView) findViewById(R.id.imageAnimation);
view.setBackgroundResource(R.drawable.animation_list_filling);
frameAnimation = (AnimationDrawable) view.getBackground();
和
我已经创建了一个xml文件
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:duration="100"
android:drawable="@drawable/tugs_00000"/>
<item
android:duration="100"
android:drawable="@drawable/tugs_00001"/>
<item
android:duration="100"
android:drawable="@drawable/tugs_00002"/>
...
<item
android:duration="100"
android:drawable="@drawable/tugs_00043"/>
</animation-list>
...
但一旦我运行应用程序,它就会不断崩溃。Android Studio当前没有错误。Karla Romero您能给我发送您的崩溃日志吗
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:duration="100"
android:drawable="@drawable/tugs_00000"/>
<item
android:duration="100"
android:drawable="@drawable/tugs_00001"/>
<item
android:duration="100"
android:drawable="@drawable/tugs_00002"/>
...
<item
android:duration="100"
android:drawable="@drawable/tugs_00043"/>
</animation-list>