解決方法有以下3種
1、在Edittext中加入以下屬性
android:cursorVisible="true"android:textCursorDrawable="@null"
2、在Edittext中加入以下屬性
android:cursorVisible="true"android:textCursorDrawable="@drawable/test_cursor"對(duì)應(yīng)的drawable文件 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <size android:width="1dp" /> <span style="font-family: Arial, Helvetica, sans-serif;"> <!-- 光標(biāo)寬度可以自己定義 --></span> <solid android:color="#008000" /> <!-- 光標(biāo)顏色可以自己定義 --> </shape>
3、如果以上沒有效果就請(qǐng)用這個(gè)
明確指定EditText的inputType屬性值inputType屬性中的textCapSentences
不要用這個(gè),國內(nèi)手機(jī)好像沒有用到這個(gè),個(gè)人證實(shí)而已,用text或者textMultiLine
android:inputType="text|textMultiLine"
以上這篇解決EditText不顯示光標(biāo)的三種方法(總結(jié))就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持VEVB武林網(wǎng)。
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注