Thanks to other SO related posts regarding SearchView
customisation I was able to customise my SearchView
to this point:
Now I'm trying to add voice search and I was able to change the voice button background resource:
int searchVoiceIconId = searchPlate.getContext().getResources().getIdentifier("android:id/search_voice_btn", null, null);
ImageView searchVoiceIcon = (ImageView) searchView.findViewById(searchVoiceIconId);
searchVoiceIcon.setImageResource(R.drawable.ic_action_mic);
searchVoiceIcon.setBackgroundColor(Color.TRANSPARENT);
However, I can't seem to get rid of the line under the voice search button.
any suggestions????
Thanks
This is a late reply but it might be helpful for future.
Add the following line:
<style name="AppTheme.SearchView" parent="Widget.AppCompat.SearchView">
<!-- Gets rid of the "underline" in the mic button-->
<item name="submitBackground">@null</item>
To your values/styles.xml file and it will remove the line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With