2012-01-18 20 views

回答

1

例如,如果你正在使用它的EditText然後去做如下:

Drawable d = getResources().getDrawable(R.drawable.your_image); 
d.setBounds(0, 0, d.getIntrinsicHeight(), d.getIntrinsicWidth()); 
//setting icon at left 
yourEditText.setCompoundDrawables(d, null, null, null); 
+0

我正在使用Button.Text在它左邊的attri和形象。 – arun 2012-01-18 08:36:55

+0

是的,它也應該應用在按鈕上。調用你的按鈕的setCompoundDrawables方法來設置圖標 – waqaslam 2012-01-18 08:38:29

+0

是啊。它的工作.. thnx很多..我想知道如果我可以使圖像轉移到按鈕的右上角使用相同.. ?? – arun 2012-01-18 09:08:10

相關問題