Reputation: 2864
I tried to implement a SearchView
in ToolBar
. When I try to use this option to submit my query, the submit button is located inside the ToolBar
. However, I need the button inside the SearchView
.
How can I customise the SearchView
?
Upvotes: 4
Views: 1597
Reputation: 4782
<android.support.v7.widget.SearchView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/colorAsh"
android:backgroundTint="@color/colorAsh"
android:searchIcon="@drawable/ic_search"
android:commitIcon="@drawable/ic_commit"
android:searchHintIcon="@drawable/ic_search"
android:closeIcon="@drawable/ic_close"
android:goIcon="@drawable/ic_go">
</android.support.v7.widget.SearchView>
Dont forget to change these icons.
And follow this SearchView to know each option of SearchView .
Upvotes: 1
Reputation: 8853
Use searchView.setSubmitButtonEnabled(true)
.
This will show default search submit button inside searchview.
Upvotes: 6