How to change SearchView elements' color?

后端 未结 9 1823
北海茫月
北海茫月 2020-12-31 02:47

I want to use SearchView in my project, but I have a problem with elements\' color. Let me show you: its fragmentDialog where I have my SearchView

I dont need to change

9条回答
  •  醉酒成梦
    2020-12-31 03:17

    int searchiconId = view.getContext().getResources().getIdentifier("android:id/search_button",null,null);
    ImageView imgView = (ImageView)findViewById(searchiconId);
    Drawable whiteIcon = img.getDrawable();
    whiteIcon.setTint(Color.RED); //Whatever color you want it to be
    img.setImageDrawable(whiteIcon);
    

提交回复
热议问题