如何强制AutoCompleteTextView更新下拉的高度? [英] How to force AutoCompleteTextView to update height of drop-down?

查看:547
本文介绍了如何强制AutoCompleteTextView更新下拉的高度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序连接到远程站点获取建议有一个 AutoCompleteTextView 。虽然建议是牵强我展现一个项目说搜索,请稍候的列表。请求完成后,我更新的建议列表适配器,并调用 notifyDataSetChanged

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.

然后列表内容变为新的建议(如预期),但不知何故列表保持在高度1细胞,因此,只有顶部的建议是可见的。如何强制视图重新计算下拉高度?

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?

推荐答案

似乎 showDropDown()势力重新评估推荐列表的高度。不幸的是,它也迫使它来展示,但对于我而言这是可以接受的。

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.

这篇关于如何强制AutoCompleteTextView更新下拉的高度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆