How to wrap text in textview in Android

前端 未结 18 1103
旧巷少年郎
旧巷少年郎 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:55

    I had the same problem. Following change made it work -

    android:layout_width="wrap_content"
    

    The ellipsis, maxLines, or layout_weight - all didn't make any difference. Note - The parent width is also set as wrap_content.

提交回复
热议问题