Search code examples
androidtextscale

Android textsizes different screens


I'm building a android application that need to look allright on all screen sizes. I've managed to scale drawables according to resolution with different drawable resource folders, however how can i achieve the same with pure text?

Do i really need to use different layout folders to achieve this?

Thanks for any help!


Solution

  • Use sp for text sizes and you should be fine.

    sp

    Scale-independent Pixels - This is like the dp unit, but it is also scaled by the user's font size preference. It is recommend you use this unit when specifying font sizes, so they will be adjusted for both the screen density and the user's preference.

    from Dimensions

    dp/dip can also work, but doesn't include the users font preferences.