zoukankan      html  css  js  c++  java
  • Vertical viewport was given unbounded height

    报错

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

    在使用ListView报错

    解决方案

    return ListView(
            shrinkWrap: true, // 加上这个就不会因为高度问题报错
            children: navs,
          );
  • 相关阅读:
    11 数据的增删改
    10 外键的变种 三种关系
    09 完整性约束
    03 body标签中的相关标签
    02 body标签中的相关标签
    01 HTML介绍和head标签
    08 数据类型(2)
    07 数据类型
    06 表的操作
    偶遇RecyclerView内部Bug
  • 原文地址:https://www.cnblogs.com/lude1994/p/13452824.html
Copyright © 2011-2022 走看看