我有一个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