How to set multiline,firstletter caps and disable suggestions on edittext

扶醉桌前 提交于 2019-12-07 00:37:04

问题


I have an edittext for reply to email. i want to give three properties for edittext like Multiline, First character caps and disable word suggestions. I gave like this in xml...

android:inputType="textCapSentences|textVisiblePassword"

I tried in code also... etMessage.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); I am not able to give multiline....how can i achieve this

thanks


回答1:


I found solution for this problem

Just set the following parameters in xml file..

android:inputType="textCapSentences|textVisiblePassword" These are for setting first letter of sentence to caps and disable suggestions

and write following code in ur Activity

edittext.setSingleLine(false);



回答2:


Try setting android:inputType="textMultiLine|textCapSentences|textVisiblePassword". What might be happening is that it is multiline but only one line is currently shown, in which you could say android:minLines="5" or so.



来源:https://stackoverflow.com/questions/7022581/how-to-set-multiline-firstletter-caps-and-disable-suggestions-on-edittext

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