【问题标题】:How to create a Grid View with fitted to the screen without scroll?如何在不滚动的情况下创建适合屏幕的网格视图?
【发布时间】:2021-04-21 19:17:21
【问题描述】:

我是使用颤振的新手,我想创建一个适合屏幕的网格视图,并且内部容器的高度必须根据屏幕而变化。 例如,我有两个设备,第一个看起来不错,但在第二个中会生成滚动,我希望棕色容器的高度较低以适应屏幕。

【问题讨论】:

标签: flutter dart gridview flutter-layout


【解决方案1】:
GridView.builder(
     itemCount: itemCount,
     physics: NeverScrollableScrollPhysics(),
     gridDelegate:                                          
     SliverGridDelegateWithFixedCrossAxisCount(
     crossAxisCount: 2,
     childAspectRatio: (size / size),
      ),

试图让你改变价值?

【讨论】:

    猜你喜欢
    • 2012-12-09
    • 1970-01-01
    • 2012-08-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多