Specifying virtual keyboard type for EditText in XML

 ̄綄美尐妖づ 提交于 2019-12-24 02:13:17

问题


I'm creating a ListActivity. In each list item I have a View I've created which contains a RatingBar and an EditText. In the screenshot at the bottom, you can see the virtual keyboard contains a returnline key and no "Done" key. I would like to specify a different style of keyboard to use (and hopefully retain the spell checking bar). I would like my virtual keyboard to have a "Done" key instead of a return key. Can I set the style of virtual keyboard I'm wanting in the EditText's XML? If so, how?

Thanks for your help


回答1:


Try android:imeOptions or TextView#setImeOptions(). Check the docs.




回答2:


It would appear

android:inputType="textImeMultiLine|textAutoCorrect"

does mostly what I want. It only allows me to have my EditText be 1 row, though.



来源:https://stackoverflow.com/questions/3462107/specifying-virtual-keyboard-type-for-edittext-in-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!