SearchView 喜欢 Google 播放视频应用

SearchView like Google Play Video App

我正在尝试在操作栏中实现搜索界面,就像在 Google 播放视频应用程序 (https://play.google.com/store/apps/details?id=com.google.android.videos) 中一样。 我认为它是 SearchView 小部件,但不明白如何进行相同的自定义:在其中添加按钮,设置背景,并扩展操作栏的整个宽度

使用独立的工具栏并为其设置高度,然后在其中展开菜单。

您可以将此项目添加到您的菜单中:

<item android:id="@+id/menu_search"
    android:title="@string/action_search"
    android:icon="@drawable/abc_ic_search_api_mtrl_alpha"
    pawesome:showAsAction="ifRoom|collapseActionView"
    pawesome:actionViewClass="android.support.v7.widget.SearchView"/>

@Quiny898 创建一个不错的库,看看:

https://github.com/Quinny898/PersistentSearch

我为此使用了不错的库:https://github.com/MiguelCatalan/MaterialSearchView