当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Set all current text from Edittext to upper case

问题描述:

Pretend that you wrote 5 lines of some text and you suddenly wanted it all to be in upper case! That is the problem I am trying to solve!

I have tried the setInputFilter method, but if that is chosen then I cannot use to lower case, even if I try to do that from the keyboard!

I have also tried the Edittext.setAllCaps(); but that didn't do anything.

For info, it is a poem/quote-writing app.

网友答案:

You can use toUpperCase(),

Edittext.setText(Edittext.getText().toString().toUpperCase());
分享给朋友:
您可能感兴趣的文章:
随机阅读: