AutocompleteTextView suggestion list goes up

后端 未结 7 1721
小鲜肉
小鲜肉 2020-12-15 05:18

possible duplicates Android : autocompletetextview, suggestion list displays above the textview?

I am fully trying to display suggestion list overlapping on keyboar

7条回答
  •  眼角桃花
    2020-12-15 06:18

    You can either adjust the layout so that there is more space below the AutoCompleteTextView

    or

    you can change the dropdown height android:dropDownHeight and set some high value, this would work when its inside a scrollView and the AutoCompleteTextView is near the top.

    To display the list of options on focus do something like this

    autoCompleteTextView.setOnFocusChangeListener(new OnFocusChangeListener() {
        public void onFocusChange(View v, boolean hasFocus) {
            if(hasFocus) {
                autoCompleteTextView.showDropDown();
            }
        }
    });
    

    This would display a list of options when the user focuses on the AutoCompleteTextView

提交回复
热议问题