How to change color of ListSeparatorTextViewStyle in Delimited ListView

I have a List view with seperators, for the title I am using this xml:

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/list_header_title"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingTop="2dip"
    android:paddingBottom="2dip"
    android:paddingLeft="5dip"
    android:textSize="20sp"
    style="?android:attr/listSeparatorTextViewStyle" />

      

Using the listSeparatorTextViewStyle

default color gray, how can I change this color or add an image?

+3


source to share


1 answer


You need to create your own style

.

Android source code is your best friend for quickly collecting and creating system-style styles.

Follow this path from the source downloaded via Android SDK Manager

platforms/android-19/data/res/values

You will find something like this inside styles.xml

:



For dark theme:

<style name="Widget.Holo.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
    <item name="android:background">@android:drawable/list_section_divider_holo_dark</item>
    <item name="android:textAllCaps">true</item>
</style>

      

For the theme "Light"

<style name="Widget.Holo.Light.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
    <item name="android:background">@android:drawable/list_section_divider_holo_light</item>
    <item name="android:textAllCaps">true</item>
</style>

      

By following the path above, you will get all the assets / images you need to create your own.

0


source







All Articles