Toast toast=Toast.makeText(MainActivity.this, "手机在振动", Toast.LENGTH_SHORT); View textView=toast.getView();
LinearLayout ll=new LinearLayout(MainActivity.this); ImageView iv=new ImageView(MainActivity.this); ll.setOrientation(LinearLayout.HORIZONTAL); iv.setImageResource(R.drawable.ic_launcher); ll.addView(iv); ll.addView(textView); toast.setView(ll); toast.show();
转载于:https://www.cnblogs.com/wdc224/p/3643771.html
相关资源:自定义控件带有图片的Toast