Java android: appending a newline using TextView

前端 未结 5 746
离开以前
离开以前 2020-12-09 17:34

I just want to add a new line somehow to my linear layout:

layout = (LinearLayout) findViewById (R.id.layout);  

... //some other code where I\'ve appended          


        
5条回答
  •  长情又很酷
    2020-12-09 17:39

    Simple as:

    String hello = getResources.getString(R.string.hello);
    String world = getResources.getString(R.string.world);
    textView.setText(hello + "\n" + world);
    

提交回复
热议问题