AutoCompleteTextView不能识别空格 [英] AutoCompleteTextView doesn't recognize spaces

查看:132
本文介绍了AutoCompleteTextView不能识别空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是AutoCompleteTextView在我的Andr​​oid应用程序,它装有像这样的项目:

I'm using an AutoCompleteTextView in my Android application, which is loaded with items like this one:

大烟栗鼠鼠 - Abrocoma菌

"Smoky chinchilla rat - Abrocoma cinerea"

这些都是常见的名字,许多动物的学名...

Which are common names and scientific names of many animals...

现在,如果我输入SMO是好的,项目上面是很好的显示,当我输入的东西像abrocoma(注意空格)的问题开始......瞬间我abrocoma后键入空格这些选择dissapear,仿佛序列abrocoma没有出现在该行...

Now, if I type "smo" is fine, the item above is shown nicely, the problem starts when I type things like "abrocoma " (note the space)... the instant I type the space after "abrocoma" the selections dissapear, as if the sequence "abrocoma " doesn't appear in the line...

以上只是对首字的空间真的......如果我输入黑烟是好的...

The above is only true for spaces after the first word... If I type "smoky " is fine...

更多,如果我输入黑烟栗鼠鼠 - abrocoma。它仍然显示的下拉就好了,唯一的问题是,当我开始与任何字,但第一个

More, if I type "smoky chinchilla rat - abrocoma " it still shows the dropdown just fine, the only problem is when I start with any word but the first.

我不知道这是否是AutoCompleteTextView还是我的code的误差。

I don't know if this is an error of the AutoCompleteTextView or my code.

任何方向AP preciated。

Any direction is appreciated.

问候

推荐答案

您已经采取了看的这个张贴?用户是有一个类似的问题,他写道自己是推导:

Have you taken a look at this post? The user was having a similar issue, and he wrote is own derivation:

我只是碰到了类似的问题,并写了一个简单的多字
  派生。它默认为,分隔符,但你可以设置任何
  你喜欢使用setSeparator的方法。

I just ran into a similar problem and wrote a simple multi word derivation. It defaults to a "," separator but you can set it whatever you like using the "setSeparator" method.

这篇关于AutoCompleteTextView不能识别空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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