我剛開始學習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