2

As the title states, I would like to know how to remove the screen overlay from the SearchView. It's a bit ugly and annoying. Plus it gets in the way. I'm using android.support.v7.widget.SearchView.

Here's what it looks like:

searchview overlay

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
Steve C.
  • 1,333
  • 3
  • 19
  • 50

1 Answers1

0

I have done like below, and I get no any overlay.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);

MenuItem searchItem = menu.findItem(R.id.search_city);
searchView = (SearchView) searchItem.getActionView();
searchView.setQueryHint("Search View Hint");

searchView.setOnQueryTextListener(new OnQueryTextListener() {

    @Override
    public boolean onQueryTextChange(String newText) {
        //Log.e("onQueryTextChange", "called");
        return false;
    }

    @Override
    public boolean onQueryTextSubmit(String query) {


        // Do your task here

        return false;
    }

});

return true;
}
Qadir Hussain
  • 8,721
  • 13
  • 89
  • 124