Android TextView 竖线

在开发中遇到TextView字体竖立,如图所示:

Android TextView 竖线_第1张图片

有一种比较笨的方法,但我没去尝试,就是在string.xml文件中,没一个文字后尾加\n可以换行;例如:

 

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="@string/hello"/>

你\n好\n!

但不用这么干,可以设置layout_width = "wrap_content",

android:ems = "1";即可

你可能感兴趣的:(Android TextView 竖线)