如果你只想放置一个drawable,你可以使用下面的代码。
android:drawableRight="@drawable/my_icon" />
而如果你是在edittext中寻找图片的点击,有几种方法:
1)有一个自定义布局,你可以看到这个。
2)通过在相对布局中有一个edittext和button来检查下面的代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter search key" />
<ImageButton
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/search"
android:layout_centerVertical="true"
android:layout_margin="5dp"
android:text="Button"/>
</RelativeLayout>
3)通过自定义相对布局检查此链接