4

I want to change the font face in my application. I want change for all components TextView in my application, how can do that ?

FinalSpirit
  • 569
  • 1
  • 6
  • 17

2 Answers2

1

UPDATED ANSWER:

@Override  
public View getView(int position, View view, ViewGroup viewGroup)
{
 View v = super.getView(position, view, viewGroup);
 ((TextView)v).setTypeface(font);
 return v;
}

Override the default getView method and set your font as typeface as mentioned above.

Pattabi Raman
  • 5,814
  • 10
  • 39
  • 60
  • You don't answer to my question. I know set a typeface programmatically. – FinalSpirit Feb 13 '12 at 19:07
  • For each component, we must create a custom class who override getView ? I can't set a value in the manifest or an other file to use the same font for all components in my application ? – FinalSpirit Feb 14 '12 at 14:55
0

I think the best way for you is to set theme for your application. Applying styles and themes link should help.

brighteyed
  • 146
  • 3
  • 6