我使用「選擇器」替換imagebutton的background.Now背景可以替換隻有當我按下圖像按鈕。如果我不按它,背景將成爲原始圖片。我想要得到這個結果:原始背景是No.1圖片。按下後,即使沒有按下它,也會被No.2圖片替換。 關於替換imagebutton背景的一些問題
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="false" android:drawable="@drawable/nav_product"></item>
<item android:state_pressed="true" android:drawable="@drawable/nav_product_a"></item>
在選擇,它有許多parameters.I不知道我應該在活動中使用其one.Or要我的代碼?
請添加結果你得到的與預期的結果圖像。 – Ian 2011-12-21 04:33:48