Android中SearchView修改字体颜色
首先获取searchView控件,比如在actionbar上获取:
SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
if(searchView == null) {
return;
}
int id = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) searchView.findViewById(id);
textView.setTextColor(Color.WHITE);