Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
512 views
in Technique[技术] by (71.8m points)

android studio加载图标.ttf文件 但是预览界面无法显示对应图标

根据网上查找到方式在项目里添加了字体文件
如果使用如下代码直接在TextView设置 那么可以正常显示
image.png

Typeface typeface=Typeface.createFromAsset(context.getAssets(),"fonts/fontawesome-webfont.ttf"); 
text.setTypeface(typeface);

甚至在基础的Activity内设置了全局效果也是可以使用的

但是这些效果只能在模拟器或者真机上可见

在android studio的预览界面内看不到效果 请问有啥方式可以在预览界面上看到效果


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...