EditText without auto-correction, etc

后端 未结 4 1655
情歌与酒
情歌与酒 2020-12-05 22:23

My EditText needs to accept input consisting of partial words, names, etc. At least on my HTC Desire, this is difficult since the keyboard wants to suggest and/or correct so

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 23:15

    Try this if you want a multi-line EditText without displaying the underlines (auto correct):

        myEditText.setInputType(InputType.TYPE_CLASS_TEXT | 
           InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    

    Here's XML for that: android:inputType="textNoSuggestions|textMultiLine".

提交回复
热议问题