开发者

How to force AutoCompleteTextView to update height of drop-down?

开发者 https://www.devze.com 2023-02-05 14:15 出处:网络
I have an AutoCompleteTextView in my app that connects to a remote site to fetch suggestions. While suggestions are fetched I show a list of one item saying \"searching, please wait\". After the reque

I have an AutoCompleteTextView in my app that connects to a remote site to fetch suggestions. While suggestions are fetched I show a list of one item saying "searching, please wait". After the request completes, I update the suggestion list adapter and call notifyDataSetChanged.

开发者_如何学Python

Then the list contents changes to new suggestions (as expected), but somehow the list remains 1 cell in height, so that only the top suggestion is visible. How to force the view to re-calculate the dropdown height?


It seems that showDropDown() forces re-evaluation of the suggestion list height. Unfortunately, it also forces it to show, but for my purposes it was acceptable.

0

精彩评论

暂无评论...
验证码 换一张
取 消