在 Android 操作栏中设置 SearchView 的样式 [英] Styling a SearchView in Android Action Bar

查看:24
本文介绍了在 Android 操作栏中设置 SearchView 的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的操作栏中有一个搜索小部件,如下所示:

I have a search widget in my Action Bar like this:

(1) 如何更改iPhone"文字的颜色?

(1) How do I change the color of the text that says "iPhone"?

(2) 另外,如果您注意到灰色的 X——当它处于图标位置时,整个搜索小部件也是该颜色.我正在使用 Holo.Theme.Light 并使用我自己的模组.

(2) Also, if you notice the gray X -- the entire Search Widget is that color as well when it is in an icon position. I am on Holo.Theme.Light and utilizing my own mods to it.

如何在我的styles.xml 文件中更改小部件的这两种样式(假设您在此处对搜索小部件进行了更改)?

How do I change these two styles for the widget in my styles.xml file (assuming that is where you make the changes for a search widget)?

推荐答案

您必须设置

searchView.setBackgroundColor(Color.WHITE);

SearchViews 不是那么可定制.

SearchViews are not so customizable.

这篇关于在 Android 操作栏中设置 SearchView 的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆