private TextView textView;
//if you need not store each text then
private String lineText;
//if you need to store each text separately
private String List<String> lineWords;
在单击按钮时触发的方法中,或使用某些其他功能来触发此方法
private void addTextAndShowToUI(String newText){
//saves to the list
lineWords.add(newText);
// Add String to the existing String
lineText.concat(newText);
//show it to UI
textView.setText(lineText);
}
# 1 楼答案
您可以轻松实现这些功能,而不是动态添加多个TextView
假设有一个要显示的文本视图和一个按钮或特定的触发机制来动态地向屏幕添加文本
在单击按钮时触发的方法中,或使用某些其他功能来触发此方法