我刚开始学习android。我不知道如何更改ImageView
的图像?即它有一些在布局中设置的图像,但我想通过编码来改变图像,我应该怎么做?如何更改ImageView的图像?
这里是xml文件
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#cc8181"
>
<ImageView
android:id="@+id/image"
android:layout_width="50dip"
android:layout_height="fill_parent"
android:src="@drawable/icon"
android:layout_marginLeft="3dip"
android:scaleType="center"/>
感谢回答。
你能不能更清楚一点,在你的问题中,我想你可能想动态地在imageView中显示图像,例如,当我触摸并滑动下一个图像必须显示,我是吗? – 2011-02-23 10:00:21