Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android Studio中如何更改光标?_Android_Android Studio_Cursor_Selector - Fatal编程技术网

在Android Studio中如何更改光标?

在Android Studio中如何更改光标?,android,android-studio,cursor,selector,Android,Android Studio,Cursor,Selector,** 通过使用xml或design,我希望在开始将纯文本从默认颜色写入另一种颜色时更改光标的颜色。。请告诉我如何做**简易方法(对于API级别>=21) 2.在drawable中创建光标 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <size android:width="2.5dp" /&

** 通过使用xml或design,我希望在开始将纯文本从默认颜色写入另一种颜色时更改光标的颜色。。请告诉我如何做**

简易方法(对于API级别>=21)

2.在drawable中创建光标

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="2.5dp" />
    <solid android:color="color_cursor"  />
</shape>


您是在询问
编辑文本的光标吗?您是指Android Studio中的光标(因为您使用了该标记)还是指Android上的光标?可能是重复的
<EditText  
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:textCursorDrawable="@drawable/color_cursor"
    />
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <size android:width="2.5dp" />
    <solid android:color="color_cursor"  />
</shape>