我想改变字符串的字体而不在Android中使用的TextView [英] I want to change font of string without using textview in android

查看:225
本文介绍了我想改变字符串的字体而不在Android中使用的TextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android的使用字体改变以下字符串的字体和我在ListView中显示这些字体。

I want to change the below string font using typeface in android and i am displaying these fonts in listview.

private  String [] strArray ={"hello","welcome","aneesh","raja","kruhtika","ramu"};

使用

Typeface type = Typeface.createFromAsset(getAssets(),"Kokila.ttf"); 

我不使用这个TextView的任何,但我想改变字符串的字体按这将NE储存在我的资产.TTF文件。

I am not using any textview for this but i want to change the font of the string as per my .ttf file which will ne stored in assets.

请帮我。

推荐答案

创建一个字体的资产文件夹里面,把你的字体文件中的字体文件夹中。
定义你的字样像这样

Create a fonts folder inside the assets and put your fonts file inside fonts folder. Define your Typeface like this

typeFaceRegular = Typeface.createFromAsset(context.getAssets(),
            "fonts/Signika-Regular.otf");

我希望这会帮助你。

I hope this will help you.

这篇关于我想改变字符串的字体而不在Android中使用的TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆