Text-transform:uppercase equivalent in Android?

前端 未结 6 1631
鱼传尺愫
鱼传尺愫 2020-12-05 16:56

Does this exist? I need to make a TextView which is always uppercase.

6条回答
  •  余生分开走
    2020-12-05 17:33

    You could do it, only adding TYPE_TEXT_FLAG_CAP_CHARACTERS to InputType::

    editText.setInputType(android.text.InputType.TYPE_CLASS_TEXT
                       + android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);
    

    I hope be helped!

提交回复
热议问题