Java android: appending a newline using TextView

前端 未结 5 752
离开以前
离开以前 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:50

    If you just want to have some empty space between two other views, you could do this in your XML (assuming you're using XML for the layout). Something like this could work, basically putting in a View with a transparent background and given height. This is assuming you have whatever parameters you want in your TextViews.

    
    
    
    
    
    

    Also, in what you tried above... you could try a space and newline... that might work.

    nline.setText(" \n");
    

提交回复
热议问题