Ja können wir die Farbe, Größe, Position und andere Attribute von Toast ändern. Wir können Toast auch ein Bild hinzufügen.
Ein guter Blog für diesesHow To Customize Toast In Android Alle Inhalte aus diesem Blog
aufgenommen werden, können Sie eine XML erstellen und Toast aufzublasen.
Sie auch, es kann zur Laufzeit zu tun
LinearLayout layout=new LinearLayout(this);
layout.setBackgroundResource(R.color.LightOrange);
TextView tv=new TextView(this);
// set the TextView properties like color, size etc
tv.setTextColor(Color.RED);
tv.setTextSize(15);
tv.setGravity(Gravity.CENTER_VERTICAL);
// set the text you want to show in Toast
tv.setText("My Custom Toast at Bottom of Screen");
ImageView img=new ImageView(this);
// give the drawble resource for the ImageView
img.setImageResource(R.drawable.myimage);
// add both the Views TextView and ImageView in layout
layout.addView(img);
layout.addView(tv);
Toast toast=new Toast(this); //context is object of Context write "this" if you are an Activity
// Set The layout as Toast View
toast.setView(layout);
// Position you toast here toast position is 50 dp from bottom you can give any integral value
toast.setGravity(Gravity.BOTTOM, 0, 50);
toast.show();
Sobald Sie zusammen (gut) mit Toast bekommen, und seine Nachteile weiß, ich bin sicher, Sie finden [** THIS **] (https://github.com/keyboardsurfer/Crouton) nützlich! – Leeeeeeelo