AutoCompleteTextView set DropDownHint top gravity/ AutoCompleteTextView изменить уровень выпадающего списка подсказок

AutoCompleteTextView set DropDownHint top gravity/ AutoCompleteTextView изменить уровень выпадающего списка подсказок

<AutoCompleteTextView
android:id="@+id/editTextCountryRegistration_fragment_add_city"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_centerHorizontal="true"
android:hint="@string/choose_your_location"
android:gravity="center"
/>
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3" />
<AutoCompleteTextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:id="@+id/editTextCityAddNewCity"
android:layout_centerHorizontal="true" android:dropDownAnchor="@+id/editTextCountryRegistration_fragment_add_city"
android:hint="@string/choose_your_city"
android:gravity="center"
/>

 

Необходимо добавить параметр android:dropDownAnchor в xml описание AutoCompleteTextView, с указанием id элемента, к которому будет привязан выпадающий список(разумеется этот элемент должен быть выше, чем исходный. В нашем примере это элемент с id editTextCountryRegistration_fragment_add_city

Leave a Reply

Please disable your adblocker or whitelist this site!