Android 中的 QuickContactBadge 或弹出窗口

发布于 2024-12-04 06:25:51 字数 178 浏览 5 评论 0原文

我的活动中有一个自定义列表视图。列表的每个项目的左侧都有图像按钮。我想在单击按钮时显示弹出窗口。弹出窗口有一些图像按钮,例如聊天消息。 我想要一个像单击 QuickContactBadge 时那样的弹出窗口。 我该怎么做? 我可以使用 QuickContactBadge(列出我自己的联系人而不是手机的联系人)吗? 有什么帮助吗....?

There is a custom listview in my activity. Each item of list has image button at the left hand side. I want to show popup window when button is clicked. And popup window has some image buttons like chat message.
I want a popup window like when QuickContactBadge is clicked.
How can I do this?
and can I use QuickContactBadge (In list my own contacts not phone's contact)?
Any help....?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘然心甜 2024-12-11 06:25:51

您可以通过扩展Dialog 并放置您自己的自定义View 里面有你喜欢的任何按钮。

更新:

我刚刚(直观地)检查了 QuickContactBadge。您的情况的问题是如何正确定位它,以便它指向用户单击的正确列表视图项目。可能的解决方案:

  1. 将现有的列表视图布局放入 FrameLayout 中,并在其上放置一个空的 AbsoluteLayout 。当listview项被点击时,计算坐标并绘制
    AbsoluteLayout 中的 QuickContactBadge 位于右侧坐标,以便它指向单击的项目。从未尝试过这个,所以我不知道它的效果如何:

  2. 使用 ExpandableListView 单击时会展开该项目。在此展开的项目中,您可以显示 QuickContactBadge 或仅显示您希望的一些按钮。

就我个人而言,我会选择第二种方法。

You can create a custom dialog by extend a Dialog and putting your own custom View inside it with any buttons that you like.

Update:

I just checked (visually) the QuickContactBadge. The problem in your case will be how to properly position it so that it will so that it will point to the correct listview item that user clicked. Possible solutions:

  1. Put your existing listview layout inside a FrameLayout and put an empty AbsoluteLayout over it. When listview item is clicked, calculate the coordinates and draw
    QuickContactBadge in the AbsoluteLayout at the right coordinates so that it would point to the clicked item. Never tried this so I don't know how well this would work:

  2. Use ExpandableListView which expands the item when clicked. In this expaned item you could show the QuickContactBadge or just some buttons that you wish.

Personally, I'd go with 2nd approach.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文