Custom cursor color in SearchView

前端 未结 1 1135
陌清茗
陌清茗 2020-12-11 06:05

I want to change the color of the blinking cursor in a SearchView in the Actionbar (I\'m using Actionbar Sherlock for compatibility). Until now I\'ve managed to change the c

相关标签:
1条回答
  • 2020-12-11 06:48

    I just found a solution that works. I replaces the

    <style name="edittext_style" parent="@android:style/Widget.EditText">
        <item name="android:textCursorDrawable">@drawable/red_cursor</item>
    </style>
    

    with

    <style name="SearchViewStyle" parent="Widget.Sherlock.Light.SearchAutoCompleteTextView">
        <item name="android:textCursorDrawable">@drawable/red_cursor</item>
    </style>
    

    and modified my theme so that it looks like this:

    <style name="CustomTheme" parent="Theme.Sherlock.Light">
        ...
        <item name="searchAutoCompleteTextView">@style/SearchViewStyle</item>
        ...
    </style>
    
    0 讨论(0)
提交回复
热议问题