I am unable to change color of searchview back button to white color when it is in expand mode.
在展开模式下,我无法将searchview后退按钮的颜色更改为白色。
Here is my screen shot
这是我的屏幕截图
2 个解决方案
#1
We had the same problem and fixed it by setting the
我们遇到了同样的问题并通过设置来修复它
app:collapseIcon
attribute in the toolbar. Not documented very well :)
工具栏中的属性。没有记录得很好:)
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbarHeight"
app:collapseIcon="@drawable/collapseBackIcon" />
#2
create your own searchview instead using of default.. then You can anything with your custom searchview.`
使用默认设置创建您自己的搜索视图..然后您可以使用自定义搜索视图
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_gravity="top"
android:background="@color/newshour_red"
android:layout_width="match_parent"
android:layout_height="40dp">
<ImageView
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:layout_gravity="center"
android:src="@drawable/backbtn"
android:scaleType="fitCenter"
android:id="@+id/ivLeftHeader"
android:layout_width="60dp"
android:layout_height="match_parent" />
<SearchView
android:id="@+id/leftMenuSearch"
android:background="@drawable/menu_search_bg"
android:layout_width="match_parent"
android:layout_height="40dp"
android:queryHint="@string/search_text"/>
</LinearLayout>`
#1
We had the same problem and fixed it by setting the
我们遇到了同样的问题并通过设置来修复它
app:collapseIcon
attribute in the toolbar. Not documented very well :)
工具栏中的属性。没有记录得很好:)
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/toolbarHeight"
app:collapseIcon="@drawable/collapseBackIcon" />
#2
create your own searchview instead using of default.. then You can anything with your custom searchview.`
使用默认设置创建您自己的搜索视图..然后您可以使用自定义搜索视图
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_gravity="top"
android:background="@color/newshour_red"
android:layout_width="match_parent"
android:layout_height="40dp">
<ImageView
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="30dp"
android:layout_gravity="center"
android:src="@drawable/backbtn"
android:scaleType="fitCenter"
android:id="@+id/ivLeftHeader"
android:layout_width="60dp"
android:layout_height="match_parent" />
<SearchView
android:id="@+id/leftMenuSearch"
android:background="@drawable/menu_search_bg"
android:layout_width="match_parent"
android:layout_height="40dp"
android:queryHint="@string/search_text"/>
</LinearLayout>`