How to custom AutoCompleteTextView dropdown position

1.8k Views Asked by At

My app has an AutoCompleteTextView and I want the drop down list (Autocomplete suggestions) to be placed next to the letter I recently typed in.

Now it appears above the whole of AutoCompleteTextView.

I found most of people set AutoCompleteTextView's height as wrap_content but I want to use it as match_parent, so users can access to the TextView easier (because it means there is larger space to touch to get to edit the text).

And I believe that is the reason why I am struggling.

Is there any way I can keep the height as match_parent so AutoCompleteTextView will keep the long height, and the drop down list will be following the text users are typing in?

Thanks in advance.

1

There are 1 best solutions below

0
Hadi Ahmadi On

use android:dropDownAnchor="@id/drop_down_anchor" for AutoCompleteTextView in XML

drop_down_anchor is id of a view that you want to show your drop down based of it's position.