Should use “sp” instead of “dp” for text sizes

前端 未结 4 1972
清酒与你
清酒与你 2020-11-30 07:15

When I use

android:textSizes=\"20dp\" 

in my XML for a textView, I got a warning \"Should use \"sp\" instead of <

4条回答
  •  醉梦人生
    2020-11-30 08:01

    You can use sp and dp. As you know in Android settings you can change text size (Settings -> My device -> Display -> Font size). All your textView in sp would change after changing font size in settings, dp - would not change

提交回复
热议问题