简体   繁体   English

搜索对话框和搜索小部件 Android 之间的区别

[英]Difference between Search Dialog and Search Widget Android

I want to know the difference between Search Dialog and Search Widget in Android.我想知道 Android 中 Search Dialog 和 Search Widget 之间的区别。 I know how to implement each of them with code but don't know difference in terms of looks, behaviors etc. Any help would be highly appreciated.我知道如何用代码实现它们中的每一个,但不知道外观、行为等方面的差异。任何帮助将不胜感激。

The search dialog is a UI component that's controlled by the Android system.搜索对话框是一个由 Android 系统控制的 UI 组件。 When activated by the user, the search dialog appears at the top of the activity.当用户激活时,搜索对话框会出现在活动的顶部。

The search widget is an instance of SearchView that you can place anywhere in your layout.搜索小部件是 SearchView 的一个实例,您可以将其放置在布局中的任何位置。 By default, the search widget behaves like a standard EditText widget and doesn't do anything, but you can configure it so that the Android system handles all input events, delivers queries to the appropriate activity, and provides search suggestions默认情况下,搜索小部件的行为类似于标准的 EditText 小部件,不执行任何操作,但您可以对其进行配置,以便 Android 系统处理所有输入事件、向适当的活动发送查询并提供搜索建议

The basics section on how to create a search interface in the Android docs explains it really well. 有关如何在Android文档中创建搜索界面的基础知识部分解释得非常好。

http://developer.android.com/guide/topics/search/search-dialog.html http://developer.android.com/guide/topics/search/search-dialog.html

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

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