How do I get MultiAutoCompleteTextView tokenizer similar to Facebook app?(如何获得类似于 Facebook 应用程序的 MultiAutoCompleteTextView 标记器?)
问题描述
我正在创建一个具有收件人"字段的应用程序,就像 Facebook 应用程序的新消息"功能一样.
I am creating an application which has a 'To' field just like in Facebook app's "New Message" feature.
从下拉列表中选择一个项目后,我创建一个图像跨度并将其添加到 MultiAutoCompleteTextView
.我为这个视图使用了 SpaceTokenizer
.问题是当我单击退格时,光标首先移动到空白处(即空格 Tokenizer
),然后当我再次单击退格时,整个单词被删除....我想在我第一次单击退格时删除整个单词,就像 facebook 应用程序一样...
After selecting an item from the drop down list, I create an imagespan and add it to the MultiAutoCompleteTextView
. I have used SpaceTokenizer
for this view . The problem is when I click on backspace, the cursor first moves to the empty space (i.e., space Tokenizer
) and then when I click on the backspace again, the whole word gets deleted....I want to delete the whole word on my first click of backspace just like facebook app...
这是我的 SpaceTokenizer
我正在使用此代码在我的 multi-ContentText 中创建一个 TextView
I am using this code to create a TextView
in my multi-ContentText
我不确定空格 Tokenizer
是否是此类行为的正确选择...任何帮助或指针将不胜感激...
I am not sure whether the space Tokenizer
is the right option for this type of behavior...Any help or pointers will be grateful...
这里是截图以便更好地理解......
Here is the screenshot for better understanding....
我有一个文本,后跟一个空格,然后是一个光标...如果我按退格键,它首先会移动到空白处,只有当我再次按退格键时,整个文本才会被删除....
I have a text followed by a space and then a cursor...If I hit backspace, it first moves to the empty space and only when I hit backspace again the whole text is deleted....
这是另一个截图..
这里的光标并不完全位于两个 TextView
之间,这与 facebook 应用程序不同,这再次导致插入文本时出现一些问题...
Here the cursor is not exactly in between the two TextView
s unlike in facebook app which again causes some issues in inserting the text...
推荐答案
找到解决方案....
将此文本观察器添加到多自动完成文本视图
Add this textwatcher to the multiautocompletetextview
这篇关于如何获得类似于 Facebook 应用程序的 MultiAutoCompleteTextView 标记器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!