Increase the font size based on the size of the device

前端 未结 7 641
天命终不由人
天命终不由人 2020-12-14 16:53

I planned to use different font size for the textview on different device size so as to make the letters legible. I have already decided not to use different layouts for dif

相关标签:
7条回答
  • 2020-12-14 17:25

    Android has built in facilities for this- dp and sp. dp is device pixels. It basically is 1dp=1/160th of an inch. This allows you to specify the height of the font in real world size. Sp is scaled pixels. This size scales based on the default font size, so a user can scale up his system font and your app will match it. Handy for people with sight problems who need big text, while not taking up screen real estate for others.

    You should probably be using one or the other of these.

    0 讨论(0)
提交回复
热议问题