我有一個ImageButton的,我發誓我把一切都樹立正確的,但它沒有顯示在按下的狀態下,不同的圖標。這是我的。安卓:ImageButton的不顯示狀態按下
的ImageButton
<!-- HOME BUTTON -->
<ImageButton
android:id="@+id/home"
android:layout_width="45dp"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:contentDescription="Home"
android:src="@drawable/title_home"
android:layout_alignParentLeft="true"
android:onClick="onClickHome" />
標題首頁
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/title_home_pressed"/>
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/title_home_pressed"/>
<item android:state_focused="true" android:drawable="@drawable/title_home_pressed"/>
<item android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/title_home"/>
</selector>
是的,這些都是有效的圖像,它們是不同的。 title_home是唯一正在顯示的人。
我想感謝任何想法?
你是絕對正確的!哈,有時你只需要另一套眼睛來指出明顯的! – 2012-03-18 06:26:22