3

Has anyone found a way to style the widget that appears when SectionIndexer is used? Styling changes such as changing the text color or the background color.

metric152
  • 422
  • 4
  • 16
  • I am doing something similiar HERE http://stackoverflow.com/questions/10224233/alphabetindexer-with-custom-adapter-managed-by-loadermanager – Etienne Lawlor Apr 25 '12 at 06:52

2 Answers2

2

Found the answer here

You have to create a theme and apply it to an activity

Girish Nair
  • 5,148
  • 5
  • 40
  • 61
metric152
  • 422
  • 4
  • 16
  • No need to apply a theme to the whole Activity, please see the other answer to this question – pandre Nov 18 '13 at 12:31
1

i've found an answer here:

https://gist.github.com/DHuckaby/d6b1d9c8e7f9d70c39de

public class CustomListView extends ListView {

    public CustomListView(Context context, AttributeSet attrs) {
        super(new ContextThemeWrapper(context, R.style.CustomListView), attrs);
    }
}

styles.xml

<resources>
    <style name="CustomListView" parent="@style/GlobalTheme">
        <item name="android:textColorPrimary">?android:textColorPrimaryInverse</item>
    </style>
</resources>
android developer
  • 114,585
  • 152
  • 739
  • 1,270