How to remove bottom line in android SearchView component? Like in this image:
Android SearchView provides user interface to search query submitted over search provider. SearchView widget can be implemented over ToolBar/ActionBar or inside a layout. SearchView is by default collapsible and set to be iconified using setIconifiedByDefault(true) method of SearchView class.
<androidx.appcompat.widget.SearchView
app:queryBackground="@null"
...
/>
Setting this to @null in your XML will remove the colored bar.
If you using the android namespace in your SearchView
xml, the best way to remove the bottom line is:
android:queryBackground="@null"
When you get a reference to your SearchView
; This will work:
val backgroundView = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate) as View
backgroundView.background = null
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