How to change the font on the TextView?

前端 未结 16 1183
清歌不尽
清歌不尽 2020-11-22 08:09

How to change the font in a TextView, as default it\'s shown up as Arial? How to change it to Helvetica?

16条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 08:32

    Android uses the Roboto font, which is a really nice looking font, with several different weights (regular, light, thin, condensed) that look great on high density screens.

    Check below link to check roboto fonts:

    How to use Roboto in xml layout

    Back to your question, if you want to change the font for all of the TextView/Button in your app, try adding below code into your styles.xml to use Roboto-light font:

    
    
    
    
    
    
    

    And don't forget to use 'AppTheme' in your AndroidManifest.xml

    
        ......
    
    

提交回复
热议问题