How to auto size textview dynamically according to the length of the text in android?

前端 未结 7 800
不思量自难忘°
不思量自难忘° 2021-02-04 07:07

I am taking data of variable sizes from the server and setting to a textView and i wanted the textview to resize according to the length of the text set.

It is given in

7条回答
  •  情歌与酒
    2021-02-04 07:27

    There's now an official solution to this problem. Autosizing TextViews introduced with Android O are available in the Support Library 26 and is backwards compatible all the way down to Android 4.0.

    https://developer.android.com/preview/features/autosizing-textview.html

提交回复
热议问题