1.自定义位置
Toast t = Toast.makeText(Reg_FillContent_Activity.this, "用户已存在!", Toast.LENGTH_SHORT);
t.setGravity(Gravity.CENTER, 0,0 ); //居中 t.show();2.带图
Toast toast = Toast.makeText(Reg_FillContent_Activity.this, "带图的Toast!", Toast.LENGTH_SHORT); toast.setGravity(Gravity.CENTER, 0,0 ); //居中 LinearLayout toastView = (LinearLayout) toast.getView(); ImageView p_w_picpathCodeProject = new ImageView(getApplicationContext()); p_w_picpathCodeProject.setImageResource(R.drawable.icon); toastView.addView(p_w_picpathCodeProject, 0); toast.show();