Android – delete the searchview search voice button line
•
Android
Thanks for other so related posts about searchview customization, I can customize my searchview:
Now that I'm trying to add voice search, I can 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);
But I can't seem to get rid of the line under the voice search button
Any suggestions????
thank you
resolvent:
This is a late reply, but it may help in the 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>
For your values / styles.xml file, it will delete the line
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码