zoukankan      html  css  js  c++  java
  • flutter GridView报错

    报错

    I/flutter (22693): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
    I/flutter (22693): The following assertion was thrown during performResize():
    I/flutter (22693): Vertical viewport was given unbounded height.
    I/flutter (22693): Viewports expand in the scrolling direction to fill their container. In this case, a vertical
    I/flutter (22693): viewport was given an unlimited amount of vertical space in which to expand. This situation
    I/flutter (22693): typically happens when a scrollable widget is nested inside another scrollable widget.
    I/flutter (22693): If this widget is always nested in a scrollable widget there is no need to use a viewport because
    I/flutter (22693): there will always be enough vertical space for the children. In this case, consider using a Column
    I/flutter (22693): instead. Otherwise, consider using the "shrinkWrap" property (or a ShrinkWrappingViewport) to size
    I/flutter (22693): the height of the viewport to the sum of the heights of its children.

    我的GridView是引用在ListView中的

    解决方法:只需要在GridView加上以下属性就可以了

    shrinkWrap: true,
  • 相关阅读:
    习题1
    实验3阅读下面程序、分析说明运行结果,并上机验证。
    实验2利用循环计算n个圆柱体体积。
    实验1编写求圆面积的程序,要求当输入的半径r<=0时,提示输入错误,要求r为浮点型,r的数值是动态的由键盘输入;
    例7-12
    例 7-11
    例7-9
    例7-8
    例7-7
    例7-6
  • 原文地址:https://www.cnblogs.com/lude1994/p/13534931.html
Copyright © 2011-2022 走看看