How to disable the TextView maxLines programmatically?

前端 未结 4 1497
栀梦
栀梦 2021-02-04 23:55

I\'m having a hard time reseting the maxLines attribute of a TextView programmatically.

Just tried setting to 0 and it doesn\'t wo

4条回答
  •  长情又很酷
    2021-02-05 00:20

    For setting the maxLines for a text use mTextView.setMaxLines(0) or you have to programmatic-ally measure of the height text and multiply with the number of max line The result should set as the height of the textView

提交回复
热议问题