Search code examples
androidxmluser-interfacefontsdimensions

Android app UI messed up when I change from appearance from settings


I have defined font size in android application, it works perfectly in all screen sizes, but when I change font size (appearance small, medium, large or x-large) from android phone settings, the UI is messed up with respect to font.


Solution

  • You have to use dp for setting the size of Text, it will sort your problem.

    You should also refer this SO for when to using SP and DP.

    Stackoverflow link