android textview 豎行顯示

android textview 豎行顯示換個思維理解就是一行有多少個字,然後自適應多少行,只需要將  ems 設置爲1 (一行顯示1個字),layout_width="wrap_content"即可

<TextView
    android:id="@+id/action"
    android:layout_width="wrap_content" //自適應寬度,必須設置爲這個
    android:layout_height="wrap_content"
    tools:text="豎行顯示"   
    android:ems="1"  //一行顯示多少個字  
    />
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章