Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Autocomplete TextView drop down width

Tags:

java

android

I want the dropdown of my auto complete TextView to cover the entire screen width. Currently the normal behaviour of the autocomplete textview is such that it covers only the width of the EditText (screenshot below).

How do I do it ? It should look somewhat like the default maps app in android.

enter image description here

like image 291
Rohan K Avatar asked Jan 14 '12 17:01

Rohan K


2 Answers

http://developer.android.com/reference/android/widget/AutoCompleteTextView.html#attr_android:dropDownWidth

By putting the value -1 or fill_parent it should work

like image 177
Jeremy D Avatar answered Sep 24 '22 11:09

Jeremy D


autoCompleteTextView.setDropDownWidth(getResources().getDisplayMetrics().widthPixels);
like image 26
Jose Angel Maneiro Avatar answered Sep 25 '22 11:09

Jose Angel Maneiro