2011-03-13 41 views
3

是否有人找到了使用SectionIndexer時出現的小部件樣式的方法?設計更改的樣式,如更改文本顏色或背景顏色。設計sectionIndexer

+0

我正在做類似的東西在這裏http://stackoverflow.com/questions/10224233/alphabetindexer-with-custom-adapter-managed-by-loadermanager – toobsco42 2012-04-25 06:52:42

回答

3

找到了答案here

你必須創建一個主題,並將其應用到活動

+0

沒有必要申請一個主題的整個活動,請參閱其他答案對這個問題 – pandre 2013-11-18 12:31:37

1

我已經在這裏找到答案:

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); 
    } 
} 

風格。 xml

<resources> 
    <style name="CustomListView" parent="@style/GlobalTheme"> 
     <item name="android:textColorPrimary">?android:textColorPrimaryInverse</item> 
    </style> 
</resources>