Search code examples
androidandroid-stylessearchviewsearch-suggestion

Search suggestion box: each row has a white background and white text


Any idea's on how to change the style for the suggestion box? I'm targeting sdk version 16.

I tryed defining a style for the searchview(reference: android-developers.blogspot.be/2014/10/appcompat-v21-material-design-for-pre.html) with a suggestionRowLayout item but it has no effect.

 <style name="MySearchViewStyle" parent="Widget.AppCompat.SearchView">
    <item name="suggestionRowLayout">@layout/search_suggestion_row</item>
 </style>

Image: http://s22.postimg.org/p353knca9/suggestions.jpg

Image onClick Row: http://s18.postimg.org/5w0fuf0o9/seard.jpg

useful info

compileSdkVersion 22

buildToolsVersion "21.1.2"

dependencies

com.android.support:appcompat-v7:22.0.0

com.android.support:support-v4:22.0.0

App Theme

Theme.AppCompat.Light.DarkActionBar


Solution

  • I was using android.Widget.SearchView instead of android.support.v7.widget.SearchView

    menu.xml

    app:actionViewClass="android.Widget.SearchView"
    

    should be

    app:actionViewClass="android.support.v7.widget.SearchView"

    and in my Fragment class I Imported the wrong package.