Android appcompat toolbar stretches when searchview gets focus

前端 未结 10 1757
猫巷女王i
猫巷女王i 2020-12-08 08:08

I\'m updating an app to use the new Toolbar instead of the regular ActionBar. In my app the user must be able to select a contact from their contac

10条回答
  •  不知归路
    2020-12-08 08:55

    In case you are using an EditText inside Toolbar, adding "flagNoExtractUi" in imeOptions , will solve the stretching edit area.

    EditText for Search Action without stretching:

    android:id="@+id/toolbar_editText"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:inputType="text"
    android:imeOptions="actionSearch|flagNoExtractUi"
    android:singleLine="true" />
    

提交回复
热议问题