How to use icon from font file as a drawable in Android

前端 未结 2 1407
梦毁少年i
梦毁少年i 2021-01-15 15:24

I have a font file whose icons I am using in layout files via a Custom TextView.

I created a Custom Class : class CustomFontTextView extends TextView

2条回答
  •  悲哀的现实
    2021-01-15 16:09

    I think in your case its not possible to change Home up button icon via xml...you are using an iconFont, so your icon is actually a text and to display those icons you need your CustomTextView or any View, which extends the TextView. android:homeAsUpIndicator requires drawable. Possible solution could be: to have this special icon in drawable folder.

提交回复
热议问题