在android中我们可以通过以下方式更改光标颜色:
android:textCursorDrawable="@drawable/black_color_cursor".
我们怎么能动态地做到这一点?
在我的情况下,我已将光标drawable设置为白色,但我需要更改黑色怎么办?
// Set an EditText view to get user input
final EditText input = new EditText(nyactivity);
input.setTextColor(getResources().getColor(R.color.black));
Run Code Online (Sandbox Code Playgroud)