解决方法有以下3种

1、在Edittext中加入以下属性

android:cursorVisible="true"

android:textCursorDrawable="@null"

2、在Edittext中加入以下属性

android:cursorVisible="true"

android:textCursorDrawable="@drawable/test_cursor"

对应的drawable文件

android:shape="rectangle">

3、如果以上没有效果就请用这个

明确指定EditText的inputType属性值inputType属性中的textCapSentences

不要用这个,国内手机好像没有用到这个,个人证实而已,用text或者textMultiLine

android:inputType="text|textMultiLine"

以上这篇解决EditText不显示光标的三种方法(总结)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持找一找教程网。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐