Android Search Dialog and Suggestions ListView: Change theme and colours

守給你的承諾、 提交于 2019-12-01 23:47:30

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/9072262/android-search-dialog-and-suggestions-listview-change-theme-and-colours

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!