zoukankan      html  css  js  c++  java
  • EditText小写字母自动转换成大写(注:设置之后只能显示大写字母)

     1 import android.text.method.ReplacementTransformationMethod;
     2 /**
     3  * @author cloud
     4  * 
     5  */
     6 public class AllCapTransformationMethod extends ReplacementTransformationMethod {
     7   @Override
     8   protected char[] getOriginal() {
     9       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' };
    10       return aa;
    11   }
    12   @Override
    13   protected char[] getReplacement() {
    14       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' };
    15       return AA;
    16   }
    17 }
    18 //将需要转换的edittext实现该方法
    19 editext.setTransformationMethod(new AllCapTransformationMethod ());
  • 相关阅读:
    poj2352树状数组
    hdu1166树状数组
    poj2785双向搜索
    poj2566尺取变形
    poj2100还是尺取
    poj3061尺取法
    poj3320尺取法
    hdu3829最大独立集
    poj2594最小顶点覆盖+传递闭包
    经典换根dp——hdu2196
  • 原文地址:https://www.cnblogs.com/cloud9527/p/4880958.html
Copyright © 2011-2022 走看看