EditText without auto-correction, etc

后端 未结 4 1648
情歌与酒
情歌与酒 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:16

    The other suggestions are correct, but SwiftKey has decided it will ignore the inputtype values "in response to user requests". While I agree this is a bad idea since it contradicts the Google guidelines and developers usually have a good reason for disabling auto-correction (like username fields, family names and so on), it still is the most used keyboard application for Android devices, so this can be a big problem.

    The workaround is to use either

    android:inputType="textVisiblePassword"
    

    or

    .setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    

提交回复
热议问题