如何在不折叠的情况下将 ListView 放入 ScrollView? [英] How can I put a ListView into a ScrollView without it collapsing?

查看:27
本文介绍了如何在不折叠的情况下将 ListView 放入 ScrollView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我四处寻找解决此问题的方法,我能找到的唯一答案似乎是不要将 ListView 放入 ScrollView".我还没有看到任何关于为什么的真正解释.我似乎能找到的唯一原因是 Google 认为您不应该这样做.好吧,我做到了.

I've searched around for solutions to this problem, and the only answer I can find seems to be "don't put a ListView into a ScrollView". I have yet to see any real explanation for why though. The only reason I can seem to find is that Google doesn't think you should want to do that. Well I do, so I did.

那么问题是,如何将 ListView 放入 ScrollView 而不折叠到其最小高度?

So the question is, how can you place a ListView into a ScrollView without it collapsing to its minimum height?

推荐答案

使用 ListView 使其不滚动是非常昂贵的,并且违背了 ListView 的全部目的.您应该不要这样做.只需使用 LinearLayout 代替.

Using a ListView to make it not scroll is extremely expensive and goes against the whole purpose of ListView. You should NOT do this. Just use a LinearLayout instead.

这篇关于如何在不折叠的情况下将 ListView 放入 ScrollView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆