Android TextView Lines Collection

时间:2013-06-22 21:16:49

标签: android widget

我有一个TextView,它有10行作为属性和两个变量,Alpha和Beta。

我希望Alpha使用TextView的前两行,Beta使用其余的行或3-10。

如何编写Java代码?我找不到直接解决Lines集合的方法。

这不起作用:

TextView.setText.Lines[1]("This is a test\n for Alpha");
TextView.setText.Lines[3]("This is a test\n for Beta\n that has more lines\n than Alpha");

TiA Trey

1 个答案:

答案 0 :(得分:0)

你不能这样做,线条取决于TextView的宽度。如果需要,可以使用两个TextView,一个包含2行,另一个包含8个。