更改android.support.v7.widget.SearchView的颜色 [英] Change color of android.support.v7.widget.SearchView
本文介绍了更改android.support.v7.widget.SearchView的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用搜索视图.
<android.support.v7.widget.SearchView
android:id="@+id/searchView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/imageViewMenu"
>
</android.support.v7.widget.SearchView>
是否可以更改文本颜色和图标颜色以查看?
Is this possible to change text color and icon color to view?
当前显示黑色文本和图标.我想将其更改为白色文本和白色搜索图标.
Currently it shows black text and icon. I want to change it to white color text and white search icon.
推荐答案
这可能有效.
SearchView searchView = (SearchView) findViewById(R.id.search);
EditText searchEditText = (EditText)searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text);
searchEditText.setTextColor(getResources().getColor(R.color.white));
searchEditText.setHintTextColor(getResources().getColor(R.color.white));
这篇关于更改android.support.v7.widget.SearchView的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文