Published on September 14, 2017 by Android Developers

For the best user experience with text, material design recommends using a dynamic type instead of smaller type sizes or truncating larger-size text. With Android O and Support Lib 26, TextView gains a new property: autoSizeTextType, which allows the text to scale uniformly when working with dynamic content. You can fine tune the auto-size by setting the minimum and maximum values and the step granularity, or by using preset text sizes.

For more info check out these links!
Autosizing TextViews guide: goo.gl/JZ85Ap
Google I/O 2017 talk on “What’s new in Support Library”: goo.gl/Ukf4Mz

Subscribe to the Android Developers channel here: goo.gl/vLYDU

Leave a Reply

71 Comments on "TextView: Now with Auto-Sizing"

Notify of
avatar

Brent Allen
Guest
Brent Allen
1 day 18 hours ago

Thanks this helps a ton! Figured there had to be an easy way. Clear and informative.

Olaf Gottschalk
Guest
Olaf Gottschalk
14 days 16 hours ago

I wish I could supply a specific text which is only used to determine the text size to make it fit into the view, even though I currently display a shorter text… Why? Because I have fields that are counting. And I want the text size to adopt to the largest value that will eventually be displayed there…

Ruell Brown
Guest
Ruell Brown
28 days 10 hours ago

I'm having an issue where I have an autosizing textview next to an imageview (down arrow)…. we want the arrow to be next to the textview no matter what size the text is. But on longer values it's covering up the arrow.

Gangadhar S Lahane
Guest
Gangadhar S Lahane
1 month 5 days ago

what was the previous approach to achieve text view autosizing?

Reyansh Mishra
Guest
Reyansh Mishra
1 month 9 days ago

It has performance issue when used in recycler view as it calculates the sizes for every item, isn't it?

Pero Peric
Guest
Pero Peric
3 months 18 days ago

Be my wife! 🙂

Pero Peric
Guest
Pero Peric
3 months 18 days ago

Be my wife! 🙂

fgcncn gbbnfgb
Guest
fgcncn gbbnfgb
3 months 23 days ago

есть такие видео с переводом на русский

fgcncn gbbnfgb
Guest
fgcncn gbbnfgb
3 months 23 days ago

есть такие видео с переводом на русский

Vishamber lal
Guest
Vishamber lal
3 months 28 days ago

Great Work but late

1 2 3 6
wpDiscuz