我想更改搜索视图组件中显示的白色可绘制 X 标记。如何更改它。请帮我。谢谢。
SearchManager searchManager = (SearchManager)getSystemService(Context.SEARCH_SERVICE);
searchView = (SearchView)menu.findItem(R.id.ac_search).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(true);
try{
Field searchField = SearchView.class.getDeclaredField("mSearchButton");
searchField.setAccessible(true);
ImageView searchBtn = (ImageView)searchField.get(searchView);
searchBtn.setImageResource(R.drawable.ac_search);
searchField = SearchView.class.getDeclaredField("mSearchPlate");
searchField.setAccessible(true);
LinearLayout searchPlate = (LinearLayout)searchField.get(searchView);
searchPlate.setBackgroundResource(R.drawable.search_edit_text_holo_light);
AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
searchText.setHintTextColor(getResources().getColor(android.R.color.white));
searchText.setHint(R.string.ac_search_here);
searchText.setTextColor(getResources().getColor(android.R.color.white));
}catch (NoSuchFieldException e){}catch (IllegalAccessException e){}