无论我在搜索视图中输入什么,关闭按钮(X)似乎都被禁用了,而不是以白色出现。如何解决此错误,使其以白色显示?
无论我在搜索视图中输入什么,关闭按钮(X)似乎都被禁用了,而不是以白色出现。如何解决此错误,使其以白色显示?
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.menu_search_list, menu);
MenuItem item = menu.findItem(R.id.action_search);
SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
searchView.setOnQueryTextListener(this);
searchView.setQueryHint(getResources().getString(R.string.station_search_hint));
}
菜单搜索列表.xml
<?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/action_search"
android:icon="@drawable/ic_action_search_light"
android:title="@string/action_search"
android:orderInCategory="100"
app:showAsAction="always"
app:actionViewClass="android.support.v7.widget.SearchView"/>
</menu>