防止内容换行

发布于 2024-12-03 20:43:11 字数 204 浏览 6 评论 0原文

我有一个布局,有 2 个列表视图,一个在另一个之上 它们的布局高度设置为“wrap_content”,布局宽度设置为“match_parent” 两者的布局权重均为 50(即 50%) 如果两个列表视图都是空的,一切都很好,但是当上面的列表视图包含许多元素而下面的列表视图保持空时,布局会使一个列表视图增长而另一个列表视图缩小。 我希望两个列表视图永远不会改变它们在布局中的相对大小,而是滚动!

I have a layout with 2 listviews one on top of the other
their layout height is set to "wrap_content" and layout width ist "match_parent"
both have a layout weight of 50 (i.e. 50 percent)
if both listviews are empty, everything is fine, but when the upper listview contains many elements and the lower listview remains empty, the layout makes one list view grow and the other shrink.
i want both list views to never change their relative size in the layout and instead have scrolling!

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

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

发布评论

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

评论(1

浸婚纱 2024-12-10 20:43:12

不要将高度设置为wrap_content,而是将它们设置为0dip。

Don't set the heights to wrap_content, set them to 0dip instead.

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