//设置光标颜色
android:textCursorDrawable="@drawable/solid_shape_bottom_line"
//去掉光标
android:textCursorDrawable="@null"
完整代码
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="@dimen/text_size_13"
android:gravity="center"
android:textCursorDrawable="@drawable/et_cursor"/>
et_cursor.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<size android:width="1dp" />
<solid android:color="#ff000000" />
</shape>
网友评论