选择列表中AutoCompleteTextView切断的对话框 [英] Selection list cut off in AutoCompleteTextView in Dialog

查看:94
本文介绍了选择列表中AutoCompleteTextView切断的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个对话窗口,覆盖整个屏幕高度的1/3,显示在我的活动的顶部。该对话框拥有两个AutoCompleteTextView领域。

I have a dialog window that covers 1/3 of the entire screen height and is displayed on top of my activity. The dialog holds two AutoCompleteTextView fields.

我现在面临的问题是,当用户开始输入一些东西到AutoCompleteTextView,列表中的所有建议,只显示在对话框的底端,但并没有超越,即使是名单越长。它看起来像它的切断。 (截图左)

The problem I'm facing is that when the user starts typing something into the AutoCompleteTextView, the list with all suggestions only shows up to the bottom end of the dialog, but doesn't go beyond that even the list is longer. It looks like it's cut off. (screenshot left)

只有当我长preSS从建议列表中的项目,该列表将显示在全长进行。 (截图右)

Only after I long-press an item from the suggestion list, the list will be shown in full length. (screenshot right)

Screenhot是:<一href="http://img704.imageshack.us/i/dialogdropdown.png/">http://img704.imageshack.us/i/dialogdropdown.png/

Screenhot is at: http://img704.imageshack.us/i/dialogdropdown.png/

如何解决此问题,以便该列表显示全长从一开始,当用户开始输入的东西?

code-明智的没有什么特别的,我要做的就是:

Code-wise there's nothing special, all I do is:

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this.getContext(), R.layout.nav_route_autocomplete_row, locStrings);        
AutoCompleteTextView txtStartPos = (AutoCompleteTextView) findViewById(R.id.txtStartPos);
txtStartPos.setAdapter(adapter);
...

一个解决方法的想法是,以某种方式分派移动事件来模拟触摸(但不选择虽然)列表中的项目之一。一个解决方案在$ C $(c)任何具体的概念,任何人?

One workaround idea is to somehow dispatch a motion event to simulate a touch (but then not selecting though) one of the list items. Any concrete idea in code for a solution, anybody?

推荐答案

现在,我猜想这是一个错误,我已经在这里提出:的 HTTP://$c$c.google.com/p/android/issues/detail ID = 9917

Right now I'm assuming it's a bug, which I already filed here: http://code.google.com/p/android/issues/detail?id=9917

但是,如果任何人知道解决这个问题,我会非常AP preciate,并会很乐意进行交易了一段赏金点。

But if anybody knows a solution to this, I'd greatly appreciate it and would be glad to trade it for some bounty points.

编辑:

这是来到我的脑海一个解决方法是现在到对话框延伸到屏幕的最底部,但离开的背景透明的,所以它看起来象现在一样,但实际上有一个高度,不会切断列表。我会给一个尝试......

One workaround that came to my mind is now to extend the dialog to the very bottom of the screen but leave the background transparent, so it looks the same as now, but actually has a height that wouldn't cut off the list. I will give that a try...

这篇关于选择列表中AutoCompleteTextView切断的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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