0
我有一些可修复尺寸的png(a.png和b.png) 我有一个按钮。我想有情况当在按钮触摸和释放一些动画(例如,1帧 - a.png,2帧 - b.png) 当我有XML:Android上的AnimationDrawable start()与ImageView setImageDrawable(...)
...
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView_id"
android:layout_alignParentBottom="true"
android:paddingBottom="50dp"
android:paddingRight="25dp"
android:src="@drawable/a"
/>
...
当我
view.setImageDrawable(context.getDrawable(R.drawable.b));
中的OnClick(...)界面我得到我的目标(在ImageView的变化图像)
enter image description here, 但是当我做
AnimationDrawable pro2 = (AnimationDrawable)view.getBackground();
pro2.start();
我用动画列表和2个项目与a.png和b.png制作动画,为什么我不能设置动画,而不是setImageDrawable(...)?
谢谢,这个链接可以帮助我,我改的android:SRC = “@绘制/ A” 至Android:背景= “@绘制/ somename” 和它的工作 – dima