Set Specifc Font to a TextView independent to device

自闭症网瘾萝莉.ら 提交于 2019-12-21 23:24:04

问题


I want to set a custom font to the textView but the font should be device setting's independent. As i have used the Below Code:

 TextView tv=(TextView)findViewById(R.id.custom); 
  Typeface face=Typeface.createFromAsset(getAssets(), "fonts/HandmadeTypewriter.ttf"); 
  tv.setTypeface(face); 

but still the font is the one that is set by the on my samsung galaxy s3. I want to set a custom font that is independent to the device's font settings.

I have gone through following links and have tried the things but have not succeeded with results.

Link 1

Link 2

Please help.


回答1:


Just clean the project it will be done.



来源:https://stackoverflow.com/questions/20489903/set-specifc-font-to-a-textview-independent-to-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!