1. Set the horizontal line color and height between items in listview.
android:divider="#8E8E8E"
android:dividerHeight="1px"
2. Set ListView to black when multiple items are selected
android:scrollingCache="false"
3. Set ListView to select Item highlighting.
android:listSelector="@android:color/transparent"
4. Set Item to get the focus style. Select the style. No style is selected.
Divided into three parts
[1] set the basic color values/colors. xml file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="transparent">#FFD306</color>
<color name="silver">#00ffffff</color>
<color name="darkgray">#808080FF</color>
<color name="white">#FFFFFFFF</color>
<color name="red">#FE2E2E</color>
<color name="ltgray">#4B8A08</color>
<color name="pressed">#fff22fff</color>
<color name="selected">#fff33fff</color>
<color name="focused">#ffff44ff</color>
</resources>
[2] set the selector xml file path: drawable/catalog_list_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="false"
android:state_pressed="false"
android:drawable="@color/ltgray"/>
<item android:state_pressed="true"
android:drawable="@color/red"/>
<item android:state_selected="true"
android:state_pressed="false"
android:drawable="@color/red"/>
</selector>
[3] setting the background of an Item
android:background="@drawable/catalog_list_selector"