简体   繁体   English

使用自定义布局在Android中创建SearchView

[英]Create SearchView in android with custom layout

I want to create a view like this : 我想创建一个像这样的视图: SearchView模拟

It was simple to do the SearchView but how to create a extending layout below action bar or however to provide some search selection to user while searching. 执行SearchView很简单,但是如何在操作栏下方创建扩展布局,或者如何在搜索时为用户提供一些搜索选择。

I want to show a layout which will pop up when user clicks the search icon on action bar. 我想显示一个布局,当用户单击操作栏上的搜索图标时,该布局将弹出。 The layout will have the additional search criteria to be selected by user. 布局将具有其他搜索条件,供用户选择。

Any Hints and Example will be helpful. 任何提示和示例都将有所帮助。

I would suggest maybe implementing the menuItem.setOnActionExpandListener() -- when it is expanded, you can show/animate your other view below the action bar. 我建议也许实现menuItem.setOnActionExpandListener()-展开菜单时,可以在操作栏下方显示/设置其他视图的动画。 See docs for OnActionExpandListener. 请参阅文档,了解OnActionExpandListener。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM