3 c# android xamarin.android typeface xamarin
我想更改textview的字体,然后按照教程和示例中给出的代码进行操作.但我收到了错误.我的代码是
var txt = FindViewById<TextView> (Resource.Id.textView1);
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/k010.ttf");
txt.SetTypeface (tf, TypefaceStyle.Normal);
Run Code Online (Sandbox Code Playgroud)
错误说我在第二行收到错误
非静态字段方法需要对象refrance
我想在textview中使用kruti dev 10字体.
更改
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/k010.ttf");
Run Code Online (Sandbox Code Playgroud)
至
Typeface tf = Typeface.CreateFromAsset (Application.Context.Assets, "fonts/k010.ttf");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3750 次 |
| 最近记录: |