polyclefsoftware wrote: > I want to apply a non-native font to widgets in my app. This is > working fine for TextViews and Buttons, which have a setTypeface > method. The code below works just great for my button: > > Java: > Typeface face = Typeface.createFromAsset(getAssets(), "fonts/ > my_font.ttf"); > playButton = (Button) findViewById(R.id.play_button); > playButton.setTypeface(face); > > > But I just can't seem to figure out how to apply the font to a > Spinner. Any ideas?
You would need to apply it to the Views returned by your Adapter you give to the Spinner. Since TTF typefaces cannot be applied to layouts in XML, you will probably need to subclass your adapter and override getView() (or newView() if a CursorAdapter), let the superclass do its thing, then find and adjust the font on your TextView inside the View the superclass creates. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Need Android talent? Ask on HADO! http://wiki.andmob.org/hado --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---