9

I just want to use "sp" in android xml file. But to avoid the disorder of layout, I hope the max font size can be set. How to do that?

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
Chogri
  • 326
  • 3
  • 15
  • The `fontSize` is not the reason why your layout behaves that way. It's the `TextView` where you probably have set `wrap_content`. – Murat Karagöz Dec 05 '16 at 09:22
  • `sp` automatically takes care of the font sizes. You don't have to set a max font size. – Reaz Murshed Dec 05 '16 at 09:23
  • man do not pass greater then your max value of font size, sp automatically takes care of the font sizes. – Rajesh Dec 05 '16 at 09:29
  • 3
    I get you, @Murat K, @ Reaz Murshed, and I just means, can I set a upper limit in my app to limit the font scale range? – Chogri Dec 05 '16 at 09:30
  • 1
    Yes, `sp` does take care of font sizes, but it does not prevent the UI design from being corrupted by a large font size. – Stephane Nov 21 '19 at 14:07

0 Answers0