Android開發技巧:點選Button改變其背景顏色
1 2 3 |
< Button
android:layout_width = "wrap_content" android:layout_height = "wrap_content" />
|
1 |
android:background="@drawable/upload"
|
1 2 3 4 |
< ImageButton
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:src = "@drawable/upload" />
|
1 2 3 4 5 6 7 8 9 |
<? xml version = "1.0" encoding = "utf-8" ?>
< selector xmlns:android = "http://schemas.android.com/apk/res/android" >
< item
android:state_pressed = "true"
android:drawable = "@drawable/up_pressed" />
<
|