Question

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

Was it helpful?

Solution

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);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top