Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove icon from searchview in ActionBar

I am using action bar support v7 library. When I expand search view I get look like this.

enter image description here

I dont want this search icon on left. Instead I want to place it in hint like image below.

enter image description here

I want to do this programmatically. How can I achieve this?

Thanks.

like image 921
NinjaCoder Avatar asked Jan 10 '23 16:01

NinjaCoder


1 Answers

I think I figured out what the answer is.

To expand searchview by default if I use

mSearchView.setIconifiedByDefault(false); 

it will show search bar like first image

If I use mSearchView.onActionViewExpanded(); then it shows like second image.

like image 117
NinjaCoder Avatar answered Jan 19 '23 04:01

NinjaCoder