0

Can anyone help me with this? I am working with a SearchView in order to look for places of a list. I would like to change the background color and also the icon of the action button of the soft keyboard. Keep in mind that the SearchView is not in the toolbar.

This is my code:

XML:

<androidx.appcompat.widget.SearchView
    android:id="@+id/search_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:theme="@style/AppSearchView"
    android:imeOptions="actionSearch|flagNoExtractUi|flagNoFullscreen"
    android:inputType="text"
    app:queryHint="Search something..."/>

Check the image about what I want to change

1 Answers1

0
  1. You can use searchView.setBackgroundColor(Color.WHITE); to change the background color of your searchView.
  2. And to change your keyboard icon you can use android:imeOptions on your editText TAG.

eg:

<EditText
android:imeOptions="actionSearch" 
android:inputType="text" />

You can find more options in the android developer site.

KalanaChinthaka
  • 323
  • 4
  • 13