Android ListView - 在 ListView 中添加 ListView 时使父级展开以显示所有子级

发布于 2024-08-21 15:39:19 字数 549 浏览 3 评论 0原文

基本上,我有一个自定义 ListView,其中每个项目如下所示:

<行> <文本视图/> <按钮/> <

ListView/ >

每个item中的ListView默认是GONE,当单击按钮。一切似乎都工作正常,除了当 ListView 足够长可以滚动时,它只是被截断了。

http://img38.imageshack.us/img38/3269/listviewproblem.png

这是单个列表项的最大高度的问题吗?有没有办法强制列表项展开并强制子列表视图展开以显示所有子项?我做错了什么?

Basically, I have a custom ListView in which each item looks like:

<LinearLayout>

<Table> <Row> <TextView/> <Button /> </Row> </Table>

<ListView />

</LinearLayout>

The ListView in each item is GONE by default and is set to VISIBLE when the button is clicked. Everything seems to work fine with the exception that when the ListView is long enough to scroll, it is just kind of truncated.

http://img38.imageshack.us/img38/3269/listviewproblem.png

Is this a problem with the maximum height of an individual list item? Is there a way to force the list item to expand and force the child listview to expand to show all children? What am I doing wrong?

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

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

发布评论

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

评论(1

没有你我更好 2024-08-28 15:39:19

对列表项使用单独的相对布局,

借助自定义高效适配器在列表活动中设置布局。

就这样。

use seperate relative layout for listitem

set the layout in list activity with the help of custom efficientadapter.

thats all.

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