I solved this quite simply by adding a colorAccent specifically to my toolbar theme, which was different to the colorAccent on the rest of my app.Įg. 1 Answer Sorted by: 3 If you want to change only the cursor color, you can use: <.textfield.TextInputLayout style'style/' android:theme'style/'. EditText cursor and pointer color for below android 5.0. How to change color of the bubble (under cursor) on EditText (programmatically) 10. This is what the cursor looks like before and after applying the new theme, respectively.Īs a final note, you can always alter the width and color of the new cursor by modifying appropriate fields in your Drawable: Change EditText Cursor color through styles.xml. First, you add the aforementioned attribute to your main theme as follows: then create the style for "cursorColor" which will reference the cursor Drawable that you will create (next step): final thing to do is to to create the cursor drawable (cursor.xml) that will be used as the replacement cursor: Modifying the code you provided in the example, you would do something like the following. After alot of experimentation, I was finally able to change the cursor color by using the autoCompleteTextViewStyle attribute, along with a custom cursor Drawable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |