Android 搜索对话框和建议 ListView:更改主题和颜色
我已经实现了一个简单的搜索对话框,根据此处的指南,在我的应用程序中(通过自定义提供程序)执行数据的自定义搜索:http://developer.android.com/guide/topics/search/search-dialog.html
问题在于搜索栏的颜色和大小(超过操作栏的高度,等)不适用于我的应用程序的设计。我知道如何在 styles.xml 文件中创建主题,但我不知道如何定位 Android 搜索对话框和建议 listView。有谁知道我该怎么做?
I've implemented a simple search dialog that performs a custom search of the data within my app (Via a custom provider) as according to the guidelines here: http://developer.android.com/guide/topics/search/search-dialog.html
The problem is that the search bar's colors and size (exceeds the height of the action bar, etc) do not work within the design of my app. I know how to create a theme in my styles.xml file, but I do not know how to target the Android search dialog and suggestions listView. Does anyone know how I can do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这个问题上花费了 13 个小时后,结果发现由于某种原因这是不可能的。确实具有视觉定制搜索对话框的应用程序(即使只是颜色)必须手动实现它们,并且可能不使用标准搜索界面。
After 13 hours spent on the question, it turns out it's not possible for some reason. Apps that do have visually customized search dialogs- even if it's just the colours - must implement them manually, and probably don't use the standard search interfaces.
根据 google 文档,SearchDialog 是
“搜索对话框是由 Android 系统控制的 UI 组件”。
因此,要控制搜索视觉效果,请像今天一样使用:
ActionBarSherlock dev 分支
https://github.com /JakeWharton/ActionBarSherlock/tree/dev
和这个:
http://developer.android.com/guide/topics/search/search -dialog.html#ConfiguringWidget
实现完全可控的搜索
as per google docs SearchDialog is
"The search dialog is a UI component that's controlled by the Android system."
So to have a control over search visuals use as for today :
ActionBarSherlock dev branch
https://github.com/JakeWharton/ActionBarSherlock/tree/dev
and this :
http://developer.android.com/guide/topics/search/search-dialog.html#ConfiguringWidget
to implement fully controlable search