Прямо сейчас, я могу изменить курсор, вытягиваемый с помощью отражения, и используя свойство android:textCursorDrawable
. Я просмотрел код TextView
и фактически прочитал чертежи из Resources.Theme. Мне интересно, возможно ли его и как его изменить, создав пользовательскую тему в styles.xml
?Изменить EditText Цвет курсора через styles.xml
final Resources.Theme theme = context.getTheme();
/*
* Look the appearance up without checking first if it exists because
* almost every TextView has one and it greatly simplifies the logic
* to be able to parse the appearance first and then let specific tags
* for this View override it.
*/
TypedArray a = theme.obtainStyledAttributes(attrs,
com.android.internal.R.styleable.TextViewAppearance, defStyleAttr, defStyleRes);
Возможный дубликат [Установить цвет курсора EditText] (http://stackoverflow.com/questions/7238450/set-edittext-cursor-color) –