Here's what my SearchView looks like with the Android Support Library version 23.0.4 :

And here is what it looks like using Support Library 24.0.0 :

How can I get SearchView to correctly display text in 24.0.0? This is not a FYI text color problem, I have the adjusted text color EditText to no avail. You can also see that the "x" button on the right is missing.
Update
Here is the XML I use for my search menu:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/search"
android:icon="@drawable/nav_icon_search"
android:title="@string/search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="ifRoom|collapseActionView" />
</menu>
Here is the code I use in my onCreateOptionsMenu:
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_location_list, menu);
this.configureSearchView(menu);
super.onCreateOptionsMenu(menu, inflater);
}
private void configureSearchView(Menu menu) {
MenuItem search = menu.findItem(R.id.search);
MenuItemCompat.setOnActionExpandListener(search, this);
this.mSearchView = (SearchView)
MenuItemCompat.getActionView(search);
this.mSearchView.setOnQueryTextListener(this);
this.mSearchView.setOnCloseListener(this);
this.mSearchView.setSubmitButtonEnabled(false);
this.mSearchView.setIconifiedByDefault(true);
this.mSearchMenuItem = search;
}
source
share