Write a paragraph using textview on Android

后端 未结 2 1426
谎友^
谎友^ 2021-02-14 04:26

I want to write a paragraph as part of my mobile application. How do I go about it?

2条回答
  •  醉梦人生
    2021-02-14 05:18

    Use \n to break line.

    Example:

    TextView t = findViewById(R.id.text);
    t.setText("This is the first line\nThis is the second line\nThird line...");
    

提交回复
热议问题