自动替换输入的字符
2016-06-13 11:41
120 查看
简单理解:自动替换输入的字符,比方说全部字母转换为大写。
et_input.setTransformationMethod(new AllCapTransformationMethod());
public class AllCapTransformationMethod extends ReplacementTransformationMethod { @Override protected char[] getOriginal() { char[] aa = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; return aa; } @Override protected char[] getReplacement() { char[] cc = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; return cc; } }
相关文章推荐
- sql 嵌套查询
- maven
- Service进程间通信AIDL
- Android通过HttpURLConnection与HttpClient联网代理网关设置
- 八-应用Wireshark过滤条件抓取特定数据流
- MySQL 配置
- 【51CTO学院三周年】朱老师物联网大讲堂-“需求分析版”-感谢朱有鹏老大带我装C,带我飞
- 献给初学者:谈谈如何学习Linux操作系统
- 如何在windows下使用git及github仓库管理项目
- 2016年6月9日--6月11日 3天端午节假期
- Android内存优化
- 类与类之间的几种关系
- bootstrap导航条
- 大数完整模板
- nginx 代理概念理解
- mybatis-mysql小优化
- BootStrap 智能表单实战系列(二)BootStrap支持的类型简介
- Java全局搜索字符串
- Picasso网络图片加载框架的使用
- spring自定义注解!