First letter capitalization for EditText

后端 未结 17 2027
傲寒
傲寒 2020-11-28 01:11

I\'m working on a little personal todo list app and so far everything has been working quite well. There is one little quirk I\'d like to figure out. Whenever I go to add a

17条回答
  •  Happy的楠姐
    2020-11-28 01:51

    Set input type in XML as well as in JAVA file like this,

    In XML,

    android:inputType="textMultiLine|textCapSentences"

    It will also allow multiline and in JAVA file,

    edittext.setRawInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
    

    make sure your keyboard's Auto-Capitalization setting is Enabled.

提交回复
热议问题