Build a SearchView Widget with v21 Support Library

Chris Banes mentioned here that the Lollipop SearchView API has now been updated in the AppCompat library. I follow the instructions directly from the blog post, but I see no effect.

Below is a snippet from my values/styles.xml

 <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/color_primary</item> <item name="searchViewStyle">@style/CustomSearchViewStyle</item> </style> <style name="CustomSearchViewStyle" parent="Widget.AppCompat.SearchView"> <item name="queryBackground">@color/orange</item> <item name="searchIcon">@drawable/test</item> </style> 
+6
source share
1 answer

I used android.widget.SearchView instead of android.support.v7.widget.SearchView . I assume only android:* styles work with android.widget.SearchView .

+13
source

Source: https://habr.com/ru/post/977039/


All Articles