How to wrap text in textview in Android

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

    OK guys the truth is somewhere in the middle cause you have to see the issue from the parent's view and child's. The solution below works ONLY when spinner mode = dialog regardless of Android version (no problem there.. tested it in VD and DesireS with Android =>2.2) :

    1. .Set you spinner's(the parent) mode like :

      android:spinnerMode="dialog"  
      
    2. Set the textview's(child custom view) properties to :

      android:layout_weight="1"  
      android:ellipsize="none"  
      android:maxLines="100"  
      android:scrollHorizontally="false"
      

    I hope this works for you also.

提交回复
热议问题