How to wrap text in textview in Android

前端 未结 18 1135
旧巷少年郎
旧巷少年郎 2020-12-08 18:03

Does any one know how to wrap text in TextView in Android platform. i.e if the text in textview exceed the screen length it should be displayed in the second line.

I

18条回答
  •  孤城傲影
    2020-12-08 18:37

    For the case where the TextView is inside a TableLayout, the solution is to set android:shrinkColumns="1" on the TableLayout. (Replace 1 with the column number the TextView you want to wrap is in. (0-indexed))

    AFAICT, no other attributes are needed on the TextView.

    For other cases, see the other answers here.

    FWIW, I had initially gotten it to sort of work with

     

    but that resulted in some extra empty space at the bottom of the Dialog it was all in.

提交回复
热议问题