Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change SearchView back Icon color

Is there a way to change the color of the arrow displayed on a SearchView when its expanded? enter image description here

I have tried everything with no results.

like image 792
Mr. Thanks a lot Avatar asked Nov 29 '22 09:11

Mr. Thanks a lot


1 Answers

To change Back Icon color add below attribute in your android.support.v7.widget.Toolbar Toolbar

app:collapseIcon="@drawable/back_arrow"

Also to change close button icon add the following piece of code

ImageView searchClose = searchView.findViewById(android.support.v7.appcompat.R.id.search_close_btn);
searchClose.setImageResource(R.drawable.close);
like image 185
MashukKhan Avatar answered Dec 04 '22 12:12

MashukKhan