2011-11-20 111 views
2

我有這個簡單的代碼,帶給我一個圖像烤麪包。有沒有可能有這種烤麪包的常用烤麪包的背景?吐司與圖像背景

THX提前

 Toast ImageToast = new Toast(getBaseContext()); 
     LinearLayout toastLayout = new LinearLayout(getBaseContext()); 
     toastLayout.setOrientation(LinearLayout.HORIZONTAL); 
     ImageView image = new ImageView(getBaseContext()); 
     TextView text = new TextView(getBaseContext()); 
     image.setImageResource(R.drawable.smile); 
     text.setTextSize(30); 
     text.setText("Show this text"); 
     toastLayout.addView(image); 
     toastLayout.addView(text); 
     ImageToast.setView(toastLayout); 
     ImageToast.setDuration(Toast.LENGTH_LONG); 
     ImageToast.show(); 

回答

1

你必須創建一個完整的自定義佈局提到here