在 xml 文件对应代码中添加:

 android:textCursorDrawable="@drawable/test_cursor"

drawable 文件名 test_cursor 里面内容为:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <size android:width="1.4dp" /> 

    <!-- 光标颜色可以自己定义 -->
    <solid android:color="#ff000000" />
    <corners android:radius="10dp"/>
</shape>

更多好内容戳下面:

https://blog.csdn.net/wuqingsen1

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐