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" //一行顯示多少個字
/>