How to change font style for spinner item
I have a spinner with 开发者_开发百科items, populated via ArrayAdapter. I want to change font style for some (not for all) of spinner items, both for spinner's combobox and listbox. I guess that I need to subclass something, but I don't understand what. How can I do that?
Thanks!
Ok I got it.
- Subclass ArrayAdapter and override getView and getDropDownView.
- In those methods, call super.getView or super.getDropDownView and save returned value.
- Set Typeface for view returned at (2) (thx Sameer Segal).
You need to apply fonts (typeface) to the TextViews of the layouts. Extract them through R.id.* or by supplying your own custom layout
精彩评论