Android 搜索对话框和建议 ListView:更改主题和颜色

发布于 2024-12-29 15:39:32 字数 347 浏览 3 评论 0原文

我已经实现了一个简单的搜索对话框,根据此处的指南,在我的应用程序中(通过自定义提供程序)执行数据的自定义搜索: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

断舍离 2025-01-05 15:39:32

在这个问题上花费了 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.

倾城月光淡如水﹏ 2025-01-05 15:39:32

根据 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文