简体   繁体   English

Android Actionbar SearchView

[英]Android Actionbar SearchView

I want to implement Actionbar SearchView same as QuizUp (attached pictures). 我想实现与QuizUp相同的Actionbar SearchView(附带图片)。 My code structure is, one main activity with multiple fragments. 我的代码结构是一个主要活动,其中包含多个片段。 Actionbar SearchView is common feature and not related to the any fragment and result will be fetched from remote service. 动作栏SearchView是常用功能,与任何片段无关,其结果将从远程服务中获取。

Need help with some sample codes. 需要一些示例代码的帮助。 Pls check attached images to get clear idea about my requirement. 请检查随附的图片,以明确了解我的要求。

Thanks 谢谢

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++

第1步

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++

第2步

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++

第三步

I think it is kinda impossible with simple SearchView. 我认为使用简单的SearchView几乎是不可能的。

You can do it with transparent activity. 您可以通过透明活动来做到这一点。

For example, you have menuItem with search button, when user click it, application open new activity with transparent background and searchView 例如,您有带有搜索按钮的menuItem,当用户单击它时,应用程序将使用透明背景和searchView打开新活动

How to create transparent activity 如何创建透明活动

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

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