【发布时间】:2011-09-03 17:27:15
【问题描述】:
我只是想以某种方式在我的线性布局中添加一个新行:
layout = (LinearLayout) findViewById (R.id.layout);
... //some other code where I've appended some strings already
final TextView nline = new TextView(this);
nline.setText(Html.fromHtml("<br>")); //i also tried: nline.setText("\n");
layout.addView(nline);
但这只是增加了几个空格。有人可以帮我吗?谢谢。
【问题讨论】:
-
nline.setText(Html.fromHtml("
"));如果添加 nline.setSingleLine(false); 将正常工作
标签: java android textview newline