문제

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

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top