当我在XML一个TextView定义,如何添加新行了吗? \ñ接缝到不行。
<的TextView
机器人:ID =@ + ID / txtTitlevalue
机器人:文本=1号线:\正线2 \正行3
机器人:layout_width =54dip
机器人:layout_height =FILL_PARENT
机器人:TEXTSIZE =11像素/>
解决方案
不信任的可视化编辑器。 您的code确实在动车组的工作。
When I define in a TextView in XML, how do I add new line to it? \n seams to not work.
<TextView
android:id="@+id/txtTitlevalue"
android:text="Line1: \n-Line2\n-Line3"
android:layout_width="54dip"
android:layout_height="fill_parent"
android:textSize="11px" />
解决方案
Don't trust the Visual editor. Your code does work in the emu.