Pregunta

I am using Monodroid to make an app and I can't figure out how to make a custom font.

Below is my code

TextView text = FindViewById<TextView>(Resource.Id.tvchange);
Typeface tf = Typeface.CreateFromAsset(Assets,"fonts/gt.otf");
text.SetTypeface(tf);

There is no getAssets() in Monodroid so I have no idea if the typeface is correct, and the text.SetTypeface(tf); expects two arguements, the second I don't know.

Thanks

¿Fue útil?

Solución

I found out the problem

Here is the code below

 Typeface tf = Typeface.CreateFromAsset(Application.Context.Assets, "fonts/gt.otf");
 TextView ExplodeVin = FindViewById<TextView>(Resource.Id.tvExVin);
 ExplodeVin.SetTypeface(tf,TypefaceStyle.Normal);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top