Search code examples
androidandroid-actionbaractionbarsherlocksearchview

Android SearchView Icon


I want to disable the Mag icon displayed inside the search view component. Any idea how to reference it and remove it or replace it with another drawable ?

enter image description here


Solution

  • In your theme:

    <style name="Theme" parent="Your parent theme">
    <item name="android:searchViewSearchIcon">@android:drawable/ic_search</item>
    </style>
    

    Edit:
    searchViewSearchIcon is a private attribute. This answer therefore does not work (on the native ActionBar).