Android中SearchView修改字体颜色

首先获取searchView控件,比如在actionbar上获取:
  1. SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
  2. if(searchView == null) {
  3. return;
  4. }
  5. int id = searchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
  6. TextView textView = (TextView) searchView.findViewById(id);
  7. textView.setTextColor(Color.WHITE);


 



posted @ 2014-09-10 11:32  fighter  阅读(7301)  评论(0编辑  收藏  举报