Multiline TextView in Android?

前端 未结 20 1332
南方客
南方客 2020-11-29 17:26

I did like below in xml


    

        
相关标签:
20条回答
  • 2020-11-29 18:23

    The best answer I found for multiline TextView is:

    android:inputType="textMultiLine"
    
    0 讨论(0)
  • 2020-11-29 18:25

    Simply put '\n' inside your text... no extra attribute required :)

              <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="Pigeon\nControl\nServices"
                android:id="@+id/textView5"
                android:layout_gravity="center"
                android:paddingLeft="12dp"/> 
    
    0 讨论(0)
提交回复
热议问题