Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Gridview:自定义选择器保持空白_Android_User Interface - Fatal编程技术网

Android Gridview:自定义选择器保持空白

Android Gridview:自定义选择器保持空白,android,user-interface,Android,User Interface,我想为我的gridview使用列表选择器。我通过android:listSelector属性将其添加到xml中 我的选择器如下所示: <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_pressed="true" android:drawable="@drawable/selected_item_highlight" /> &

我想为我的gridview使用列表选择器。我通过android:listSelector属性将其添加到xml中

我的选择器如下所示:

<selector xmlns:android="http://schemas.android.com/apk/res/android" >
    <item android:state_pressed="true" android:drawable="@drawable/selected_item_highlight" />
    <item android:state_focused="true" android:drawable="@drawable/selected_item_highlight" />
    <item android:drawable="@android:color/transparent" />
</selector>

其中选定的\u项目\u高亮显示如下所示:

<shape 
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="rectangle">
     <corners
        android:radius="3dp" />
     <solid
        android:background="@color/ListHighlighting" />
</shape>

但网格保持空白。当我将选择器中的drawable属性更改为drawable=“@color/ListHighlighting”时,整个网格-每个项目-get将以颜色高亮显示

怎么了