Android 当我将样式设置为gridview线时,我丢失了选择器

Android 当我将样式设置为gridview线时,我丢失了选择器,android,styles,selection,itemselector,Android,Styles,Selection,Itemselector,我想在gridview中列出我的项目。网格视图连接了一个适配器。此适配器具有布局xml。那么xml是: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="ma

我想在gridview中列出我的项目。网格视图连接了一个适配器。此适配器具有布局xml。那么xml是:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >
    <TextView
        android:id="@+id/txtUrunAd"
        style="@style/gridline"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_weight="40"
        android:text="@string/GrdUrunAd" />
     <TextView
        android:id="@+id/txtMiktar"
        style="@style/gridline"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_weight="15"
        android:text="@string/GrdMiktar" />
    <TextView
        android:id="@+id/txtBirim"
        style="@style/gridline"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_weight="15"
        android:text="@string/GrdBirim" />
    <TextView
        android:id="@+id/txtFiyat"
        style="@style/gridline"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_weight="15"
        android:text="@string/GrdFiyat" />

    <TextView
        android:id="@+id/txtTutar"
        style="@style/gridline"
        android:layout_height="match_parent"
        android:layout_width="1dp"
        android:layout_weight="15"
        android:text="@string/GrdTutar" />
</LinearLayout>

如果小心的话,我的布局有一种风格。 设置此样式时,gridview失去了选择器效果。 删除此样式时,gridview具有选择器效果

    <style name="gridline" parent="AppBaseTheme">
        <item name="android:singleLine">true</item>
        <item name="android:ellipsize">marquee</item>
        <item name="android:marqueeRepeatLimit">marquee_forever</item> 
        <item name="android:focusable">true</item>
        <item name="android:focusableInTouchMode">true</item>
        <item name="android:scrollHorizontally">true</item>
        <item name="android:background">@color/grdlinebackcolor_white</item>
    </style>

符合事实的
帐篷
永远的帐篷
符合事实的
符合事实的
符合事实的
@颜色/灰色背景颜色\u白色

我认为您的问题是将背景设置为纯色。选择器是可绘制的,设置为项目背景

删除true,tryi尝试了这个,但不起作用。是的,我的问题是这个。但我没有孤独。。我试了一种拖拉的。我确实构建了一个xml形状,但没有改变任何东西。但我意识到,我还是躲在我的抽屉下面。。但我不知道解决办法。有你?