If you want to change the left arrow button in the search box, add the application: collapseIcon.
<android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/colorPrimary" app:collapseIcon="@drawable/ic_search_view_home" />
If you want to change the text color and text color, add the following.
EditText searchEditText = searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text); searchEditText.setTextColor(Color.WHITE); searchEditText.setHintTextColor(Color.WHITE);
If you want to change the close icon, add the following.
ImageView imvClose = searchView.findViewById(android.support.v7.appcompat.R.id .search_close_btn); imvClose.setImageResource(R.drawable.ic_search_view_close);
Zin Myo Oo Dec 19 '17 at 17:07 on 2017-12-19 17:07
source share