我使用 xamarin.android 来开发应用程序,我尝试使用代码自定义字体:
Typeface myfont = Typeface.CreateFromAsset (Context.Assets, "fonts/KhmerOS.ttf");
但是当我构建时,出现错误,如下所示:
Error CS0120: An object reference is required for the non-static field, method, or property 'Android.Content.Context.Assets.get' (CS0120)
请帮我,
最良好的问候
文塔
这可能是迟到的回复,但可能会对遇到同样问题的人有所帮助。将字体文件的 BuilAction 设置为 Android Asset。 (右键单击字体文件->BuildAction 选择 AndroidAsset)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)