Android Editext右侧加一个图片,图片可以点击,
这个应该正常的布局加在你的editext 右边。
就是简单的给 Editext 右边加一个ImageView 或者ImageButton(用那个图片做背景),然后给 ImageButton.setOnClickListenner();
和其他点击事件一样写就行。
然后呢?问的问题都不完整。。。。
我要实现的效果是 图片在Editext里面,不是放在editext右边 是放在里面 右侧。。 你们给点代码我感觉会好些
是像这样吗
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/c_white"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="@drawable/sel_grid_time"
android:orientation="horizontal"
android:padding="10dp" >
<EditText
android:id="@+id/searchkey"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.80"
android:background="@color/c_white"
android:completionHint="猜您要搜索"
android:hint="请输入网点名称"/>
<ImageButton
android:id="@+id/bt_search"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:background="#00000000"
android:onClick="searchButtonProcess"
android:src="@drawable/btn_branches_search_big" />
</LinearLayout>
</LinearLayout>