Android EditText:触摸时选择所有文本,并在用户开始输入时清除. [英] Android EditText: select all text while touch and clear when user starts typing.

查看:227
本文介绍了Android EditText:触摸时选择所有文本,并在用户开始输入时清除.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序中有一个编辑文本.当用户触摸编辑文本时,应选择整个文本,并且当他开始键入文本时应清除.一个示例是浏览器地址栏.有什么办法吗?请帮帮我.

I have a edit text in my app. When the user touches the edit text the whole text should be selected and when he starts typing text should be cleared. An example is browser address bar. Is there any way to do this?Please help me.

推荐答案

您可以使用

android:selectAllOnFocus 以及 查看全文

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