Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make SearchView always expanded in android?

I have SearchView in the top of the layout (not in the action bar), is there anyway to force this View to be always expanded (opened)?

If not, i wish to place fancy image near it, is there anyway to make SearchView hide this image when expanded (clicked/expanded)?

like image 543
ruruma Avatar asked Jun 09 '14 14:06

ruruma


1 Answers

You can use the property android:iconifiedByDefault="false" on XML or set programatically setIconifiedByDefault(false). Acording to the documentation this property set the SearchView expanded like you want.

Take a look at SearchView.setIconifiedByDefault(boolean iconified)

like image 183
Wakim Avatar answered Oct 03 '22 11:10

Wakim