How to use Font Awesome icon in android application?

后端 未结 9 2112
时光说笑
时光说笑 2020-12-02 20:58

I want to use Font Awesome\'s icon set in my android application. I have some TextView to set those icons. I don\'t want to use any png image. My Textview is li

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 21:59

    If anyone wants to assign font value programmatically then this is how I did. Create an assets folder if it's not there and put ttf file in the folder

    Typeface type = Typeface.createFromAsset(getContext().getAssets(), "fonts/fa_solid_900.ttf");
    tvHeart.setTypeface(type);
    tvHeart.setText(Html.fromHtml(""));
    

提交回复
热议问题