Reputation: 775
I used the appcompat to implemented the actionbar, now I want to change the clear icon. And I have done this:
<item android:id="@+id/action_search_note"
android:title="@string/search_title"
android:orderInCategory="101"
android:icon="@drawable/ic_action_search"
snailnote:showAsAction="collapseActionView|ifRoom"
snailnote:actionViewClass="android.support.v7.widget.SearchView" />
my team:
<item name="searchViewCloseIcon">@drawable/search_clear_normal</item>
I also tried to add
<item name="android:searchViewCloseIcon">@drawable/search_clear_normal</item>
but it is giving an error, and I final removed it.
But it dosen't work, how should I change the clear icon in a right way.
Upvotes: 1
Views: 1036
Reputation: 421
<style name="SearchViewStyle" parent="Widget.AppCompat.SearchView">
<item name="closeIcon">@drawable/search_clear_normal </item>
</style>
Upvotes: 0
Reputation: 11
<style name="AppTheme" parent="@style/Theme.Base.AppCompat.Light.DarkActionBar">
<item name="actionBarWidgetTheme">@style/YourActionBarWidget</item>
</style>
<style name="YourActionBarWidget" parent="@style/Theme.AppCompat">
<item name="searchViewCloseIcon">@drawable/xxx</item>
</style>
Upvotes: 1