0

我发现这是一个愚蠢的问题,但我似乎无法在网上找到答案。我想将 2 个 TextView 添加到 LinearLayout 并希望它们在彼此下方显示结果,而不是连接。

ll.addView(textview);
ll.addView(textViewReply);

显示:

HelloHello to you too!

虽然我希望它是:

Hello
Hello to you too!

我认为线性布局每行只能存储一个对象。有人可以解释一下吗?:-)

4

1 回答 1

1

在添加 textview 之前尝试 ll.setOrientation(LinearLayout.VERTICAL)

于 2013-10-18T13:34:15.710 回答