How to make SearchView always expanded in android?

后端 未结 4 1648
攒了一身酷
攒了一身酷 2021-01-01 08:56

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 n

4条回答
  •  伪装坚强ぢ
    2021-01-01 09:08

    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)

提交回复
热议问题