Reputation: 329
I am working on an app needing a SearchView in the search fragment.
I obviously know how to create a classic SearchView
, but how is it possible to customize it to get a result like this :
Upvotes: 1
Views: 2897
Reputation:
Use CardView
to wrap the SearchView
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
app:cardBackgroundColor="@android:color/darker_gray"
app:cardCornerRadius="5dp"
app:cardUseCompatPadding="true">
<android.support.v7.widget.SearchView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.v7.widget.CardView>
Upvotes: 8