Luk*_*kap 4 android image selector drawable touch-event
在drawable文件夹中:
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
     <item android:state_pressed="true"
           android:drawable="@drawable/icon2" /> 
     <item android:drawable="@drawable/icon3" /> 
 </selector>
并且布局只是简单的线性布局,填满整个空间
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background="@drawable/on_touch_"
    android:weightSum="1" android:focusable="true" android:focusableInTouchMode="true">
</LinearLayout>
当我按此时没有任何反应
例如,如果我添加一些textview并android:background="@drawable/on_touch_"在按下时分配该textview,则会正确更改图像.
线性布局的问题在于,为何在按下时不会改变图像?
编辑:我确信我的drawable选择器是好的和工作因为我把它作为其他元素的背景,它正在工作.
但我的问题是如何将drawable设置为根元素