我有一个多行 TextView 需要显示服务器的状态。因此,当服务器状态发生变化时,它应该始终添加新行。但是,当我使用 mTextview.Text=string.Format("connected\n");
或 mTextview.SetText("...")
新行不会不会立即显示,而是在所有进程完成时显示。谁能帮我把它改成自动显示的TextView?谢谢
logTextView.Text = string.Format ("Client log:\n");
.......
logTextView.Text=string.Format("Socket connected to 172.27.27.1\n");
.......
logTextView.Text = logTextView.Text+string.Format ("Start send image to server\n");
.......
最佳答案
你应该使用:
YourTextView.setText("Connected\n");
要添加多行,请使用:
YourTextView.append("another line\n");
关于java - 如何动态追加新行到多行 TextView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29962647/