/ / Wenn ich Stil auf Gridview Linie eingestellt habe ich verloren Auswahl - Android, Stile, Auswahl, Itemselector

Wenn ich Stil auf Gridview Linie eingestellt habe ich verloren Auswahl - Android, Stile, Auswahl, Itemselector

Ich möchte meine Artikel in der Gridview auflisten. In der Rasteransicht wurde ein Adapter angeschlossen. Dieser Adapter hat ein Layout-XML. dann ist 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>

Wenn Sorgfalt aufgewendet wird, hat mein Layout einen Stil. Wenn ich diesen Stil einstelle, verliert mein Gridview den Selector-Effekt. Wenn ich diesen Stil lösche, hat mein Gridview Selektor-Effekt.

    <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>

Antworten:

0 für die Antwort № 1

Ich denke, dein Problem besteht darin, den Hintergrund als feste Farbe zu setzen. Selektoren sind Zeichenobjekte, die als Hintergrund für Objekte festgelegt sind