我刚刚开始学习机器人。我不知道如何改变 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"/>
谢谢你的回复。