动态调整 LinearLayout 内的可扩展列表视图的大小

发布于 2024-12-20 18:52:21 字数 185 浏览 3 评论 0原文

我在 LinearLayout 内部有一个可扩展列表视图,周围有其他小部件和内容。

我试图弄清楚是否有一种方法可以更改layoutHeight,以便能够匹配expandableListView的大小,其可见内容的变化以及父级的扩展和收缩。

wrap_content 似乎在布局文件中不起作用。有没有办法在运行时做到这一点?

I have a expandableListView inside of linearLayout with other widgets and content surrounding it.

I'm trying to figure out if there is a way to change the layoutHeight to be able to match the size of the expandableListView its visible content changes and parents are expanded and contracted.

wrap_content doesn't seem to work in the layout file. Is there a way to do it at runtime?

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

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

发布评论

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

评论(1

傲影 2024-12-27 18:52:21

相对布局可能反应更好。

A relative layout may respond better.

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