输入的EditText与Android的模式 [英] EditText input with pattern android

查看:100
本文介绍了输入的EditText与Android的模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的EditText中,我不得不接受的字母用户输入这是特定图案,和连字符的 - 自动插入

I am having a EditText in which I have to accept alphanumeric input from user which is specific to pattern, and hyphens '-' are inserted automatically.

"XXX-XXX-XXXX"

如何实现这一目标?是否有任何的Andr​​oid模式的工具?

how to achieve that ? Is there any pattern tool in android ?

推荐答案

您可以使用addTextChangedListener来的EditText结果
请参阅本<一个href=\"http://stackoverflow.com/questions/4172242/live-editing-of-users-input/4172392#4172392\">question ,这表明它

You can use addTextChangedListener to EditText
Refer this question , which demonstrate it

这篇关于输入的EditText与Android的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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