1

Can anyone help me to remove this or change it to another color ?

This Picture

Thank You so much for your help

jack jay
  • 2,493
  • 1
  • 14
  • 27
JA Haha
  • 43
  • 2
  • 8

3 Answers3

4

Add this to your SearchView in xml, if using API 21 or higher. If using an API lower than 21. use android instead of app.

app:queryBackground="@android:color/transparent"
Bassinator
  • 1,682
  • 3
  • 23
  • 50
jack jay
  • 2,493
  • 1
  • 14
  • 27
3
View v = searchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
v.setBackgroundColor(Color.parseColor("here give color code for background"));
sanjeev kumar
  • 541
  • 4
  • 20
  • 1
    Usually it is a good idea to add an explanation on what your code does. This allows newer developers to understand how the coed works. – Caleb Kleveter Jan 04 '17 at 14:52
2

u can use

View searchplate = (View)mSearchView.findViewById(android.support.v7.appcompat.R.id.search_plate);
            searchplate.getBackground().setColorFilter(ContextCompat.getColor(this, R.color.another_color) ,PorterDuff.Mode.MULTIPLY);
Atif Afridi
  • 61
  • 2
  • 12