1

With window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); I was able to prevent the dropdown of my AutoCompleteTextView from going behind the soft input keyboard, but it is now flush against the keyboard as shown in the following image:

Is there a way to add a margin between the AutoCompleteTextView dropdown and the soft input keyboard?

ephemient
  • 198,619
  • 38
  • 280
  • 391

1 Answers1

1

Add dropdown height to your autocomplete textview in xml as android:dropDownHeight="100dp"

Sagar Pujari
  • 343
  • 1
  • 11
  • There would be excess space if I hardcode the dropDownHeight instead of doing wrap_content when there's only 1 or 2 items to show in the dropdown, –  Feb 07 '17 at 22:06
  • You can set dropdown height dynamically based on number of items as `autoCompletetxtView.setDropDownHeight(int);` – Sagar Pujari Feb 09 '17 at 09:06
  • To do this effectively, I'd have to determine how many items will be displayed in the dropdown at a given moment. I don't think there's a way to do get this information. –  Feb 09 '17 at 20:19