dpi value of default “large”, “medium” and “small” text views android

后端 未结 3 1119
野的像风
野的像风 2020-12-22 15:18

Does the documentation ( or anyone) talks about the dpi values of the default

  • Large TextView {android:textAppearance=\"?android:attr/textAppearanceLarge
3条回答
  •  执笔经年
    2020-12-22 15:55

    To put it in another way, can we replicate the appearance of these text views without using the android:textAppearance attribute?

    Like biegleux already said:

    • small represents 14sp
    • medium represents 18sp
    • large represents 22sp

    If you want to use the small, medium or large value on any text in your Android app, you can just create a dimens.xml file in your values folder and define the text size there with the following 3 lines:

    14sp
    18sp
    22sp
    

    Here is an example for a TextView with large text from the dimens.xml file:

    
    

提交回复
热议问题