How to capitalize every letter in an Android EditText?

后端 未结 10 1686
离开以前
离开以前 2021-01-07 17:41

I have an array of editTexts which I make like this:

        inputs[i] = new EditText(this);
        inputs[i].setWidth(376);
        inputs[i].setInputType(         


        
10条回答
  •  南笙
    南笙 (楼主)
    2021-01-07 18:18

    This will make all the characters uppercase when writing.

    edittext.setFilters(new InputFilter[] {new InputFilter.AllCaps()});
    

    Original answer here.

提交回复
热议问题