Textview: adjust font size to match parent

19,205
android:autoSizeTextType="uniform"

add this line to your TextView

Edit: this line will work for api 26 and higher so if you want to use it for api lower than 26 use this

app:autoSizeTextType="uniform"

if adding this line gives you error ignore the error by adding

tools:ignore="MissingPrefix"
Share:
19,205

Related videos on Youtube

AngryOliver
Author by

AngryOliver

Welcome If you see this page, the nginx web server is successfully installed and working. Further configuration is required. Thank you for visiting.

Updated on October 03, 2022

Comments

  • AngryOliver
    AngryOliver over 1 year

    Is it possible to set font size to automatically match_parent?

    My TextView is already width/height="match_parent" but the font size is small and doesn't fit to the parent size.

    How to do that?

    • AngryOliver
      AngryOliver almost 10 years
      The problem is it takes into account only the width of the parent.