Dynamic Text size change according to tablet

前端 未结 4 1636
独厮守ぢ
独厮守ぢ 2020-12-14 03:51

With all effort,I finally reached to the end of my first app in android. And thanks to all. But after coming to end, I realized one thing that my app text size is common in

4条回答
  •  萌比男神i
    2020-12-14 04:55

    It's quite an old question, but another modern solution can be really handy.
    With the Support library, 26+ new text auto sizing is available.
    In simple words, you define TextView size and text size gets automatically increased/decreased to match it's bounds:

    
    

    More on Autosizing TextViews

    Add here the ability to set TextView size in a percentage of the screen with the ConstraintLayout, and you can create layouts which look almost identically on any device.

提交回复
热议问题