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

Actually, Settings font size affects only sizes in sp. So all You need to do – define textSize in dp instead of sp, then settings won’t change text size in Your app.

Here’s a link to the documentation: Dimensions

However please note that the expected behavior is that the fonts in all apps respect the user’s preferences. There are many reasons a user might want to adjust the font sizes and some of them might even be medical – visually impaired users. Using dp instead of sp for text might lead to unwillingly discriminating against some of your app’s users.

i.e:

android:textSize="32dp"

Leave a Comment