private Context mContext;
mContext = this;
final Toast toast = Toast.makeText(mContext, “这是一条提示信息!”, Tosast.LENGTH.SHORT);
// 设置Toast显示得位置
toast,setGravity(Gravity.CENTER_VERTICAL, 0, 0);
// 自定义
LinearLayout layout = toast.getView();
TextView v = layout.findViewById(R.id.message);
v.setTextColor(Color.parseColor("#f86c37"));
layout.setBackgroundColor(Color.BLUE);
ImageView imageview = new ImageView(this);
image.setImageResource(R.mipmap.ic_launcher_round);
layout.addView(image, 0);
Buttont btn = findViewById(R.id.btn);
btn.setOnClickListener(new View.onClickListener() {
@Override
public void onClick(View v) {
toast.show();
}
})