How do I specify eg. Roboto-Medium or Roboto-Black in styles.xml

前端 未结 4 1186
忘了有多久
忘了有多久 2021-01-30 03:24

Posts like this How to change fontFamily of TextView in Android suggests, that the variants of Roboto fonts you can specify in styles.xml in Android 4.2 boils down to the follow

4条回答
  •  天涯浪人
    2021-01-30 03:38

    I suggest you to use custom libraries like Android-RobotoTextView or Calligraphy. With one of these you can set the font of a view in xml with an attribute so you can put in in styles.xml . And they works with previous version of Android than 4.0

提交回复
热议问题