防止内容换行
我有一个布局,有 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要将高度设置为wrap_content,而是将它们设置为0dip。
Don't set the heights to wrap_content, set them to 0dip instead.