Issue
I am struggling with the selection of font sizes in my Android app. I have a number of real devices, different sizes, different OS versions, different manufacturers, phones and tablets.
The text looks good on all of those devices.
However, when I run the app in the emulator, the fonts are often too large. Obviously, this has to do with the display size and resolution settings for my virtual devices. So I have been toying around a bit with different instructions I could find on the web including a virtual device repository and the Samsung skins. Still, I don't seem to get a good match between real and virtual devices. As an example, the Nexus 5 virtual device preconfigured shows the fonts are monstrous. Font sizes I use are between 10sp for small text and 26sp for very large headers.
I could now configure the emulator such that my app looks great but then I really can't be sure what users will see on their real hardware. What is the right approach for gaining enough confidence that my app looks good in the real world?
Solution
Since you are using sp as unit for font sizes, the fonts are scaled according to your user's preferences. If you don't want to allow your fonts to be scaled you should use dp as unit for font sizes.
But I wouldn't recommend doing this because this limits accessibility for users with impaired eyesight.
Answered By - Emanuel Seidinger
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.