How to change searchview icon color?

后端 未结 9 1265
北海茫月
北海茫月 2020-12-19 13:19

I know there\'s already a lot of answers for this question here, and I wouldn\'t be creating another thread if I hadn\'t already tried everything I saw here. Anyway, the qu

9条回答
  •  既然无缘
    2020-12-19 13:54

    Use below code:

    ImageView searchIcon = searchView.findViewById(R.id.search_button);
    searchIcon.setColorFilter(Color.WHITE);
    

    If you want to change close icon color, use this one:

    ImageView searchClose = searchView.findViewById(R.id.search_close_btn);
    searchIcon.setColorFilter(Color.WHITE);
    

提交回复
热议问题