2012-01-18 44 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

相关问题