Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.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
Android:在应用程序中添加helvetica neue字体_Android_Fonts - Fatal编程技术网

Android:在应用程序中添加helvetica neue字体

Android:在应用程序中添加helvetica neue字体,android,fonts,Android,Fonts,我正在制作一个应用程序,其中我必须使用helvetica neue字体进行文本处理,但问题是我不知道如何在android中使用helvetica字体。我的问题是android是否支持helvetica字体,是的,然后如何使用该字体,因为我无法在windows首选项中找到helvetica字体颜色和颜色字体。如有任何帮助,将不胜感激。 谢谢 然后在你的活动中, 1. TextView txt = (TextView) findViewById(R.id.custom_font);

我正在制作一个应用程序,其中我必须使用helvetica neue字体进行文本处理,但问题是我不知道如何在android中使用helvetica字体。我的问题是android是否支持helvetica字体,是的,然后如何使用该字体,因为我无法在windows首选项中找到helvetica字体颜色和颜色字体。如有任何帮助,将不胜感激。 谢谢

然后在你的活动中,

   1. TextView txt = (TextView) findViewById(R.id.custom_font);  
   2. Typeface font = Typeface.createFromAsset(getAssets(), "<font file name>.ttf");  
   3. txt.setTypeface(font);  
1。TextView txt=(TextView)findViewById(R.id.custom_字体);
2.Typeface font=Typeface.createFromAsset(getAssets(),“.ttf”);
3.设置字体(字体);
有关更多信息,请参阅:


来自API Level 26的android支持直接从项目中添加自定义字体,而无需创建自定义文本视图或编辑文本

请从以下链接中查找:

您需要在应用程序中包含相应的字体文件(ttf)。希望您知道Helvetica仅对个人使用免费。
   1. TextView txt = (TextView) findViewById(R.id.custom_font);  
   2. Typeface font = Typeface.createFromAsset(getAssets(), "<font file name>.ttf");  
   3. txt.setTypeface(font);