Font size of TextView in Android application changes on changing font size from native settings

前端 未结 14 2105
抹茶落季
抹茶落季 2020-12-04 07:47

I want to specify my own text size in my application, but I am having a problem doing this.

When I change the font size in the device settings, the font size of my

14条回答
  •  萌比男神i
    2020-12-04 08:24

    You can use this code:

    android:textSize="32dp"
    

    it solves your problem but you must know that you should respect user decisions. by this, changing text size from device settings will not change this value. so that's why you need to use sp instead of dp. So my suggestion is to review your app with different system font sizes(small,normal,big,...)

提交回复
热议问题