andu wrote: > How are you all! > > I am developing android application. currently I am creating a user > interface in my language, Amharic. I can change the font for Textview, > button and other controls. But I can change the font for ListView and > Spinner control. When I search the internet I found out that Listview > and spinner has their own textview to keep the text. But I don't know > how to access the textview component of this controls. > > 1. How can I change the typeface of Listview and Spinner? or > 2. How can I access the built-in textview of these component so that I > can change the typeface for the textview?
You will need to take control over what goes into the ListView and Spinner. I have not experimented with these techniques on Spinner, but on ListView, you will need to override getView() (on ArrayAdapter) or newView() and bindView() (on CursorAdapter). Here is a free excerpt from one of my books that demonstrates the technique: http://commonsware.com/Android/excerpt.pdf In your case, you would use your Typeface object to update the font used by the TextView widgets in your rows. In principle, you could do this via a wrapping adapter -- this would be more reusable but a bit slower. I have an AdapterWrapper base class here: http://github.com/commonsguy/cwac-adapter and some projects that use it here: http://github.com/commonsguy/cwac-endless http://github.com/commonsguy/cwac-thumbnail -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 1.0 In Print! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

