<android.support.v7.widget.AppCompatEditText
android:id="@+id/edittext_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:layout_toStartOf="@id/image_delete"
android:background="@android:color/transparent"
android:ellipsize="none"
android:selectAllOnFocus="true"
android:gravity="center"
android:paddingStart="20dp"
android:cursorVisible="true"
android:singleLine="true"
android:textCursorDrawable="@drawable/cursor_color"
android:textIsSelectable="true"
android:textSize="40sp"
app:autoSizeMaxTextSize="100sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
/>
这是我的android.support.v7.widget.AppCompatEditText我想显示光标,当我点击任何宪章的edittext右边的章程我试过
android:textCursorDrawable="@drawable/cursor_color"
android:textIsSelectable="true"
这个属性,但仍然没有显示光标,请建议我如何实现这个
答案 0 :(得分:1)
试试这个它会正常工作
<android.support.v7.widget.AppCompatEditText
android:id="@+id/edittext_number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Nilesh Rathod"
android:textColor="@color/colorPrimaryDark"
android:ellipsize="none"
android:paddingStart="20dp"
android:cursorVisible="true"
android:singleLine="true"
android:textCursorDrawable="@drawable/test"
android:textSize="40sp"
app:autoSizeMaxTextSize="100sp"
app:autoSizeMinTextSize="12sp"
app:autoSizeStepGranularity="2sp"
app:autoSizeTextType="uniform"
/>
@绘制/测试
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<size android:width="3dp" />
<solid android:color="#d20d0d" />
</shape>