How to Change programmatically Edittext Cursor Color in android?

前端 未结 9 426
眼角桃花
眼角桃花 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条回答
  •  Happy的楠姐
    2020-12-08 15:16

    android:textCursorDrawable="@null"
    

    Then in the application:

    final EditText input = new EditText(nyactivity);
    input.setTextColor(getResources().getColor(R.color.black));
    

    Get from here

提交回复
热议问题