使用 arrayList 填充可扩展列表视图

发布于 2024-11-29 17:42:27 字数 149 浏览 6 评论 0原文

谁能告诉我有关如何执行此操作的任何好的链接? 我浏览了 15-20 个链接,但没有一个真正解释了任何事情。 我只想用 ArrayList 动态填充 ExpandableListView 或如果有 另一种方式...我很想知道。

请帮忙:(!

Can anyone tell me any good links on how to do this?
I've looked through a good 15-20 links and none have really explained anything.
I just want to dynamically populate an ExpandableListView with ArrayLists or if theres
another way... I'd love to know.

PLEASE HELP :(!

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

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

发布评论

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

评论(1

淡写薰衣草的香 2024-12-06 17:42:27

我不确定 ArrayList 是否是用于 ExpandableListView 的正确数据结构——但如果您指的是 Maps ArrayList ,那就更合适了。您可以使用 SimpleExpandableListAdapter 类来实现这一点。然后使用 ExpandableListView.setAdapter() 将其与您的视图耦合。

I'm not sure an ArrayList is the right data structure to use for an ExpandableListView -- but if you mean a ArrayList of Maps that would be more appropriate. You could do that with the SimpleExpandableListAdapter class it looks like. Then use ExpandableListView.setAdapter() to couple it with your view.

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