可点击按钮(或任何视图)内的EditText android系统 [英] Clickable Button (or any View) inside EditText in android

查看:105
本文介绍了可点击按钮(或任何视图)内的EditText android系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想有一个按钮或点击查看我的EditText上,这样我可以对点击它的一些行动。我能够把绘制在我的EditText感谢 Marcosbeirigo 获得的这个答案。但是,现在我想使它点击,这样我可以在其上执行一些动作。我知道这是可能的,HTC采用内部的EditText按钮,其股票的短信应用程序如下面的图像 -

I want to have a Button or a clickable View in my EditText so that I can perform some action on click of it. I was able to put a drawable inside my EditText thanks to Marcosbeirigo for this answer. But, now I want to make it clickable so that I can perform some action on it. I know this is possible as HTC uses buttons inside EditText in their stock sms app as shown in the following image-

在我的情况下,该按钮将被放置在任何地方,都可以在该中心还。但更主要的是我怎么可以把一个按钮的EditText?

In my case, the button will be positioned anywhere, can be in the center also. But the main thing is how can I put a button in EditText?

推荐答案

使用RelativeLayout的。发送和附加按钮是简单的Andr​​oid按键和一百六十〇分之三十二是一个TextView。把按钮和对象的EditText上TextView的,与布局arrangments播放和设置一些右填充到的EditText对象,这样里面的文字也不会在按钮去了。

Use RelativeLayout. The Send and Attach buttons are simple Android Buttons and the 32/160 is a TextView. Put the buttons and the textview on the EditText object, play with the layout arrangments and set some right padding to the EditText object so that the text inside it won't go under the buttons.

您不需要任何可绘制并听取了Android按钮的点击事件不是一个问题了。

You don't need any drawable and listening to the click event of the android buttons is not a question anymore.

这篇关于可点击按钮(或任何视图)内的EditText android系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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