📌  相关文章
📜  在 textview android 中逐行排列数组 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:40.943000             🧑  作者: Mango

代码示例1
public class MainActivity extends AppCompatActivity {    

    String[] word = {"This is text1.So it should be single line", "This is text2", "This is text3"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main); 


        TextView textView = findViewById(R.id.textureView1);
        for (int i = 0; i < word.length; i++) {
            textView.append(word[i]);
            textView.append("\n");
        }



    }


}