The dialog pop-up is located here.
How the AutoComplete results stop at the end of the pop-up view is here.
I want the results to drop down past the dialog's view to the parent view. If I can't do that then I want to limit the number of results the AutoComplete gives me to two.
This is in my on click listener for the popup menu.
addDialog.setContentView(R.layout.shoppinglistadd);
/**Capture the AutoCompleteTextView widget*/
final AutoCompleteTextView autoCompleteTV
= (AutoCompleteTextView) addDialog.findViewById(R.id.productEnteredShop);
/**Fills the autocomplete with possibilities*/
String[] acArray = getResources().getStringArray(R.array.completeFoodsList);
/**Create a new ArrayAdapter and bind shoppinglistitem.xml to each list item*/
ArrayAdapter<String> autoCompleteAdapter
= new ArrayAdapter<String>(ShoppingList.this, R.layout.shoppinglistitem, acArray);
/**Associate the adapter with textView*/
autoCompleteTV.setAdapter(autoCompleteAdapter);
android:completionThreshold This defines the number of characters that the user must type before completion suggestions are displayed in a drop down menu.
Android AutoCompleteTextView Overview Some important methods of Autocomplete list are given below: getAdapter() : This method returns a filterable list adapter used for auto completion.
You should use this method to limit the height of dropdown for AutoCompleteTextView
widget in xml:
android:dropDownHeight="size"
Or use this to do programmatically
autoCompleteTextView.setDropDownHeight(int);
Hope this help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With