I have the following problem. I've setup my Actionbar to use a Toolbar instead using the API 21 with the appcompat-v7:21. The textColorPrimary
style tag is configured to use the color @android:color/white
, so all the titles in the new Android Toolbar will have a white text color (so far so good).
Now I´ve added a SearchView, and setup a custom background to it like this:
<style name="AppTheme.Base" parent="Theme.AppCompat.Light">
<item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/status_background</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="searchViewStyle">@style/SearchViewStyle</item>
</style>
<style name="SearchViewStyle" parent="Widget.AppCompat.SearchView">
<item name="queryBackground">@drawable/search_background</item>
<item name="searchIcon">@drawable/icon_search</item>
</style>
The drawable @drawable/search_background
is a plain white rectangle. So guess what? As the title text color in the Toolbar is white, now the text color in the SearchView is white as well, and as the SearchView background is a white rectangle, the user can't see what he's typing.
My Question is: How can I have different text colors for the Android Toolbar Title and the SearchView text?