How to Change programmatically Edittext Cursor Color in android?

前端 未结 9 431
眼角桃花
眼角桃花 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:18

    2019 Updated: working smooth and easy https://material.io/develop/android/docs/getting-started/

    If you are using material component just simply use textCursorDrawable with color or your custom drawable.

        
    
            
    
        
    

提交回复
热议问题