Set specific font in a styles.xml

后端 未结 5 1705
滥情空心
滥情空心 2020-12-01 07:36

I\'m defining a style XML for my android app. I have some TTF files I want to use, how can I set the typeface to use those files as the font as opposed to the generic \"san

5条回答
  •  一向
    一向 (楼主)
    2020-12-01 08:32

    Yes, you can :)

    step 1: Create a folder and name it 'font' and put your .ttf inside it.

    step 2: Go to style.xml and do the following : -

    step 3: Use the style tag anywhere in views(TextView, TabLayout,..etc.):-

提交回复
热议问题