I'm trying to style the SearchView widget using the new AppCompat v21, but I'm facing some problems. No matter what layout I set on "suggestionRowLayout" attribute, it does nothing at all. The suggestion dropdown list of the SearchView remains the same way.
Other problem that I'm having is when the "accent color" is the same color as the "primary color", in the searchview is impossible to distinguish where is the caret. Do you know how can I change the accent color in the SearchView to only be applied there? I've found that Play Music has the same problem.
I'm following the guide from Android Developers blog:
http://android-developers.blogspot.com.es/2014/10/appcompat-v21-material-design-for-pre.html
According to what I have seen in the SearchView source suggestionRowLayout
resource value in SearchView occurs when retrieving the attributes for the SearchView and in the method getSuggestionRowLayout()
. On the other hand the implementation of SuggestionAdapter of v7 library is inflating abc_search_dropdown_item_icons_2line
.
Idea for a workaround:
Try referencing different layout with help of refs.xml
. Make sure you keep same ids for views as in abc_search_dropdown_item_icons_2line
<item type="layout" name="abc_search_dropdown_item_icons_2line">@layout/my_suggestion_row</item>