答案 0 :(得分:7)
\ n工作!!!
Toast.makeText(this, "line1\nLine2", Toast.LENGTH_SHORT).show();
答案 1 :(得分:3)
您可以自定义Toast类。这是一个例子:
Context context=getApplicationContext();
LayoutInflater inflater=getLayoutInflater();
View customToastroot =inflater.inflate(R.layout.YOUR_TOAST_LAYOUT, null);
Toast customtoast=new Toast(context);
customtoast.setView(customToastroot);
customtoast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL,0, 0);
customtoast.setDuration(Toast.LENGTH_LONG);
customtoast.show();
答案 2 :(得分:0)
Toast.makeText(this,"YOUR MESSAGE",
+"\n"+
"Your other message",
Toast.Lenght_long).show();
每次您添加
+“ \ n” +