EditText beat the cursor can not be displayed

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/One_Month/article/details/79267494

Recent Items, enter the login screen found EditText control input when there is no cursor, to find a solution to record it

Set in the EditText property Xml file
Android: CursorVisible = "to true"
Android: = textCursorDrawable "@ drawable / cursor_drawable"

cursor_drawable is a shape file, customize the color of the cursor style, shape files

<?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="@color/tv_bottom_blue" />
</shape>

Guess you like

Origin blog.csdn.net/One_Month/article/details/79267494