Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove SearchView search voice button line

Thanks to other SO related posts regarding SearchView customisation I was able to customise my SearchView to this point:

enter image description here

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.

enter image description here

any suggestions????

Thanks

like image 321
Guy S Avatar asked Sep 29 '22 09:09

Guy S


1 Answers

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.

like image 51
Red M Avatar answered Oct 05 '22 07:10

Red M