How to Change programmatically Edittext Cursor Color in android?

前端 未结 9 433
眼角桃花
眼角桃花 2020-12-08 14:23

In android we can change the cursor color via:

android:textCursorDrawable=\"@drawable/black_color_cursor\".

How can we do this dynamically?

9条回答
  •  爱一瞬间的悲伤
    2020-12-08 15:09

    You should change "colorAccent" and in order not to change this parameter for the whole application you can use ThemeOverlay. You can read more detailed in this article, the last section "Cursor and Selection"

提交回复
热议问题