在电子邮件撰写中,我想要像 Android 中的 yahoo 功能一样的设计输入
在撰写电子邮件时,当用户在 to/cc/bcc 中键入/选择电子邮件 ID 时。 假设有 7-8 个电子邮件 ID,现在用户想要删除第三个。 用户很难转到第三个并删除该第一个。所以我认为解决方案是,
- 用户输入电子邮件 ID 并点击空格或逗号。
- 那么背景上应该出现一个矩形框。
- 我想要在那个矩形框的右上角有一个十字标记。
- 如果用户想删除第三个电子邮件 ID,那么他只需点击包含该电子邮件 ID 的第三个矩形的十字标记即可。
(请参考雅虎电子邮件编辑器的下图)
我需要类似的功能。我怎样才能在android中实现?有我可以使用的标准组件吗?目前我正在使用“收件人”、“抄送”、“密件抄送”的自动完成文本视图。请帮忙。先感谢您。
In Email compose, when user types/selects email ids in to/cc/bcc.
Suppose there are 7-8 email ids and now user want to delete 3rd one.
It is very difficult for user to go to 3rd one and delete that one. So I think solution for this is,
- User enters email id and hits SPACE or COMMA.
- then one rectangular box should appear on background.
- I want an cross mark on right corner of that rectangular box.
- If user want to delete that 3rd email id,then he will just tap on cross mark of 3rd rectangle which contains that email id.
(please refer figure below from Yahoo email composer)
I need similar functionality. How can I achieve in android? Is there any standard component I can use? Currently I am using auto complete text view for To, Cc, Bcc. Please help. Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有时间编写工作代码,但我会为您指出正确的方向。在像
EditText
这样的标准组件中使用文本做一些时髦的事情的关键称为“跨度”。建议的攻击计划:
TextWatcher
添加到您的EditText
中,以便您知道文本何时发生变化。ImageSpan
(这是有点是整个事情的关键)使用位图作为构造函数参数。setSpan()
以替换您的ImageSpan
这是外观。I don't have time to write up working code, but I will point you in the right direction. The key for doing funky things with text in standard components like
EditText
are called "spans".Suggested plan of attack:
TextWatcher
to yourEditText
so you know when the text changes.Bitmap
equivalent using standard drawing APIs (i.e. createCanvas
, measure text, draw background, draw text).ImageSpan
(this is kinda the key to the whole thing) using your bitmap as the constructor argument.setSpan()
on that single character to have yourImageSpan
replace it's appearance.