我需要更改 ActionBar
中的 SearchView
的样式。特别是我需要尽可能更改文本提示颜色和 SearchView
图标。我如何在 XML 中完成此操作(甚至可能在 XML 中)?
如果这不可能,我如何才能使用自定义 View 轻松地重新创建类似的行为? SearchView
的关闭/展开行为对我特别有用。
最佳答案
你有没有尝试过这样的事情(使用 ActionBarSherlock):
AutoCompleteTextView searchText = (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
searchText.setHintTextColor(getResources().getColor(R.color.white));
searchText.setTextColor(getResources().getColor(R.color.white));
它对我来说很好。
关于Android 如何在 Actionbar 中设置 SearchView 的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9199006/