Is it possible to dynamically re-size fonts in a textview according to screen resolution? If yes how? I’m developing from an mdpi avd. But when the app is installed on hdpi text appears too small.
Is it possible to dynamically re-size fonts in a textview according to screen resolution?
Share
Use textSize and the scaled pixels sp unit is what alextsc is implying.
If you realy want to be dynmic and make you font as big as possible to fill up the width then it is possible with a textWatcher to render the text and check the size and then tweak the fonts on the fly.
The following is rather specific as I have multiple text views in a linear layout and this only resizes the text smaller once the text in one of them will not fit. It will give you something to work with though.