我遇到这个问题,我在布局中创建x个textview,在每个文本视图中存储1个字符。
然而,当文本太长时,文本不会转到下一行,它会溢出屏幕
无论如何,我是否将文字视图保留在1个屏幕中?
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
TextView[] tv = new TextView[counter];
float textSize = 65;
for (int i = 0; i < counter; i++)
{
tv[i] = new TextView(this);
tv[i].setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
tv[i].setTextSize(textSize);
tv[i].setText(""+singleText[i]);
linearLayout.addView(tv[i]);
}
setContentView(linearLayout);