如何实现 Facebook Messenger/Google Hangouts 之类的布局,以在 ANDROID 的搜索栏中预览所选项目? [英] How do I achieve a Facebook Messenger/ Google Hangouts like layout to preview selected items in search bar on ANDROID?

查看:23
本文介绍了如何实现 Facebook Messenger/Google Hangouts 之类的布局,以在 ANDROID 的搜索栏中预览所选项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上我想创建的内容可以从屏幕截图中得到最好的说明.

Basically what I want to create can be best illustrated from a screenshot.

我有一个人的列表视图,就像 FB Messenger 应用程序一样.我希望我的用户能够像屏幕截图中显示的那样拥有一个搜索栏.它应该具有以下属性:

I have a listview of people just like FB Messenger app. I want the ability for my users to have a search bar like the one shown in the screenshots. It should have the following properties:

1) 搜索栏应预览列表视图中所选人员的姓名

1) Search bar should preview names of people selected in the list view

2) 可以通过在预览搜索栏中的任何名称上按退格键来取消选择人员

2) People can be de-selected by hitting backspace on any name in the preview search bar

3) 搜索栏应该能够在用户输入时过滤底部的人员列表.

3) The search bar should be able to filter the bottom list of people as the user types.

我有属性 3) 的解决方案,但我对其他两个一无所知.请帮忙!!!

I have a solution for propert 3) but I am clueless about the other two. Please HELP!!!

推荐答案

您应该查看 this.

此类使用TextWatcherSpannableString, AutoCompleteTextView注释.

This class uses combination of TextWatcher, SpannableString, AutoCompleteTextView and Annotations.

这篇关于如何实现 Facebook Messenger/Google Hangouts 之类的布局,以在 ANDROID 的搜索栏中预览所选项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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