Break line in json string java

后端 未结 3 1181
失恋的感觉
失恋的感觉 2021-01-28 07:46

Don\'t know how to express myslef very well.As you see down in my code I have a String,an ArrayList of Strings and a spinner.

In my code I add the elements of my String

3条回答
  •  孤独总比滥情好
    2021-01-28 08:00

    Modify your string which will be shown in spinner like this

    StringBuffer accounts = new StringBuffer("one");
    stringBuffer.append("\n");
    stringBuffer.append("two");
    stringBuffer.append("\n");
    stringBuffer.append("three");
    stringBuffer.append("\n");
    stringBuffer.append("four");
    

    TextView in the spinner will populate the values in different lines provided height and width is wrap_content

提交回复
热议问题