Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android : autocompletetextview, suggestion list displays above the textview?

did one of you ever run into that problem ?

the list items displays above the textbox instead of appearing right under it !

With some high resolutions screen it displays correctly :

enter image description here

but the low resolutions it's not displaying correctly are not so low, for example, in galaxy spica (320x480px). I would like the keyboard to be brought behind the suggestions list when this one gets the focus from the user who's trying to scroll on it with one long click..

I' ve tried : android:windowSoftInputMode="stateHidden|adjustPan" in the activity manifest.xml and all other combinations. still, it's not working... I tried to change the text size, the items size, the padding, the max height of the whole autocompletetextview, the max height of dropdownlist, tried a MultiAutoCompleteTextView, even tried to nest it in a scrollview, nothing. it occurs because of the keyboard which "pushes" the list items above the textview so without the keyboard everything would be nice..

any help would be much appreciated...

like image 351
KitAndKat Avatar asked Jul 12 '11 17:07

KitAndKat


2 Answers

Just add android:dropDownHeight="100dp" to the AutoCompleteTextView tag in your layout file,

like image 124
manu Avatar answered Nov 08 '22 00:11

manu


@Override
public void onFilterComplete(int count) {

    setDropDownHeight((count > DROPDOWN_LIST_COUNT ? DROPDOWN_LIST_COUNT : count) * getHeight() 
            + DROPDOWN_LIST_BORDER);

    super.onFilterComplete(count);
}

I've encountered the same problem and tried the code above. It makes sure dropdownlist shows DROPDOWN_LIST_COUNT items.

like image 3
jun.wu Avatar answered Nov 08 '22 00:11

jun.wu