Auto Scale TextView Text to Fit within Bounds

后端 未结 30 2654
囚心锁ツ
囚心锁ツ 2020-11-21 05:49

I\'m looking for an optimal way to resize wrapping text in a TextView so that it will fit within its getHeight and getWidth bounds. I\'m not simply looking for

30条回答
  •  南笙
    南笙 (楼主)
    2020-11-21 05:53

    You can use the android.text.StaticLayout class for this. That's what TextView uses internally.

提交回复
热议问题