简体   繁体   中英

Android: AutoCompleteTextView top margin ListView

The AutoCompleteTextView displays a ListView in a popup for auto completion. On top of the popup, before the ListView begins, there ist a little margin, in effect the first line in ListView looks higher than the other entries. Is there a way to remove the margin. For me it is just a problem because a changed the "dropDownVerticalOffset" of the AutoCompleteTextView to be on bottom of the TextView, otherwise there is negative offset and you don't see the difference if height of the first line.

How can I remove this margin?

Try to add XML attribute to your AutoCompleteTextView:

android:popupBackground="color_what_you_want_to_background"

Hope, it helps you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM