Android的:如何做在右侧点击箭头创建自定义的EditText [英] Android: How to do create custom EditText with a clickable arrow on the right

查看:776
本文介绍了Android的:如何做在右侧点击箭头创建自定义的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个EditText有一个修改:在右侧,但仍然在的EditText里面应该有一个向下的箭头,我可以设置 OnClickListener 来,这样,当用户点击它显示一个菜单的箭头。

I would like to have an EditText with one modification: on the right but still inside the EditText there should an arrow pointing downwards that I can set OnClickListener to so that when the user clicks on the arrow it displays a menu.

什么是做到这一点的最好方法是什么?

What is the best way to do this?

推荐答案

我通过将这样做的EditText 和一个按钮进入 RelativeLayout的,按钮(其中有自定义背景绘制)的重叠编辑框

I did this by putting EditText and a Button into RelativeLayout, the Button (which has custom background drawable) is overlapping the EditBox.

当用户点击就可以了,编辑框没有收到点击事件

When user clicks on it, the EditBox doesn't receive the click event.

这篇关于Android的:如何做在右侧点击箭头创建自定义的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆