简体   繁体   English

如何将一个列表视图中的两个列表视图添加到页面视图构建器颤动中

[英]How to add Two listview in one listview into the pageview builder flutter

我在列表视图中使用了两个列表视图,当我将整体列表视图放在页面视图中时,页面视图不可滚动

Instead of using Listviews inside each other, I suggest you to use a GridView .我建议您使用GridView ,而不是在彼此内部使用 Listviews 。 I think your ListView s have different directions.我认为您的ListView有不同的方向。 If they do, GridView s will help you.如果他们这样做, GridView会帮助你。

Other solution, if you insist on using ListView , then wrap the ListView s with ConstrainedBox then give them BoxConstraints其他解决方案,如果您坚持使用ListView ,则用ConstrainedBox包装ListView ,然后给它们BoxConstraints

ConstrainedBox(
  constraints: BoxConstraints(maxHeight: 100, maxWidth: 200)
  child: ListView(),
)

You should adjust maxHeight and maxWidth in the proper size.您应该将maxHeightmaxWidth调整为适当的大小。

Hope this helps.希望这可以帮助。

it looks like you are looking for sliverlist看起来你正在寻找 sliverlist

SliverList & SliverGrid SliverList 和 SliverGrid

or sliver tool或条子工具

sliver_tools sliver_tools

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM