tags:

views:

40

answers:

1

hello

I was wondering how to assign a style via code in adroid.

suppose I have a TextView created with the following snippet:

TextView myText = new TextView(this);     

how do I assign the class xxx so that myText will be styled like an hard coded TextView like this:

<TextView style="@style/xxx" /> 

thanks

A: 

Ups, sorry this is for Textview Styled by code.

Typeface face = Typeface.createFromAsset(getAssets(), "fonts/my_font.ttf");
TextView myText = new TextView(this);     
myText.setTypeface(face); 
Jorgesys