Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Xamarin C的android项目中包含外部字体ttf#_Xamarin - Fatal编程技术网

在Xamarin C的android项目中包含外部字体ttf#

在Xamarin C的android项目中包含外部字体ttf#,xamarin,Xamarin,我正在用C#NET中的Xamarin Studio开发一个android应用程序。我必须在应用程序中使用外部字体(TTF)文件。我已将此ttf文件复制到资产文件夹中。现在,如何通过axml或代码在应用程序中使用它 它是一个Xamarin.Android应用程序 请帮忙。像这样: var typeface = Typeface.CreateFromAsset (context.Assets, fileName); 其中filename将是您的字体名称,例如Roboto Light.ttf和con

我正在用C#NET中的Xamarin Studio开发一个android应用程序。我必须在应用程序中使用外部字体(TTF)文件。我已将此ttf文件复制到资产文件夹中。现在,如何通过axml或代码在应用程序中使用它

它是一个Xamarin.Android应用程序

请帮忙。

像这样:

var typeface = Typeface.CreateFromAsset (context.Assets, fileName);
其中
filename
将是您的字体名称,例如
Roboto Light.ttf
context
是您的
context