How to remove or change the search view icon inside the edittext? I am using the Appcompat libra
You might use below lines of code:
int searchMagIcon = getResources().getIdentifier("search_mag_icon", "id", "android");
ImageView SearchHintIcon = (ImageView) searchView.findViewById(searchMagIcon);
That will save the ImageView and then you can change it.
Per the AppCompat v21 blog post, you can provide a custom style for your SearchView
, overriding things such as the search icon:
<style name="Theme.MyTheme" parent="Theme.AppCompat">
<item name="searchViewStyle">@style/MySearchViewStyle</item>
</style>
<style name="MySearchViewStyle" parent="Widget.AppCompat.SearchView">
<!-- Search button icon -->
<item name="searchIcon">@drawable/custom_search_icon</item>
</style>