AutoCompleteTextView 建议结果在不应显示时粘在屏幕上

发布于 2024-09-24 23:51:55 字数 724 浏览 0 评论 0原文

我的 AutoCompleteTextView 是使用自定义适配器创建的,用于显示约 3000 个字符串的建议。在输入视图中输入内容时,建议会按预期出现,只是有时带有建议的下拉视图的一大块被剪掉或看起来像是与 AutoCompleteTextView 分离的。下拉列表中的这个额外部分似乎包含了以前不再相关的建议。单击建议或输入更多字母后,“卡住”的下拉框就会消失。

编辑:我发现一旦 AutoCompleteTextView 在显示多个建议后仅显示一个建议,就会出现问题

为什么会发生这种情况?我该如何修复它?

现在我正在尝试一些事情(都不起作用):

- 在 AutoCompleteTextView 上添加 TextWatcher 并使 AutoCompleteTextView 中的 AutoCompleteTextView 无效onTextChanged 方法。

- getWindow().getDecorView().invalidate();onTextChanged 中包含此 AutoCompleteTextViewActivity 上方法

编辑:这只发生在运行 2.1 sdk 版本 7 的三星 Galaxy 手机上

my AutoCompleteTextView is created with a custom adapter to show suggestions for ~3000 Strings. while typing in the input view, suggestions are coming up as expected, except that sometimes a chunk of the dropdown view with suggestions is being clipped or looks like its detached from the AutoCompleteTextView. this extra chunk of the dropdown apears to be holding previous suggestions that are no longer relevent. upon clicking a suggestion or typing more letters - the "stuck" dropdown piece disapears.

edit: i find that once the AutoCompleteTextView is only showing one suggestion after showing more than one, the problem occurs

Why is this happening? How can i fix it?

Right now i am trying a few things(none of which are working):

-adding a TextWatcher on the AutoCompleteTextView and invalidating the AutoCompleteTextView in the onTextChanged method.

-getWindow().getDecorView().invalidate(); on the Activity containing this AutoCompleteTextView in the onTextChanged method

edit: this is only happening on the samsung galaxy s phone running 2.1 sdk version 7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文