【问题标题】:Flutter - layouts颤振 - 布局
【发布时间】:2019-09-08 02:22:43
【问题描述】:

I/flutter (8622): ══╡ 渲染库发现异常╞════════════════════════════════════ ══════════════════════════ I/flutter (8622):在 performLayout() 期间抛出了以下断言: I/flutter(8622):BoxConstraints 强制使用无限宽度。 I/flutter (8622):这些无效约束由 RenderAnimatedOpacity 的 layout() 函数提供 I/flutter(8622):以下函数,它可能计算了有问题的无效约束: I/flutter(8622):_RenderDecoration._layout.layoutLineBox(包:flutter/src/material/input_decorator.dart:819:11) I/flutter (8622):有问题的约束是: I/flutter (8622): BoxConstraints(w=Infinity, 0.0

【问题讨论】:

  • 你能把代码贴出来吗?

标签: android mobile dart flutter flutter-layout


【解决方案1】:

当我将一个列表视图放在另一个列表视图或任何其他类型的列表视图中时,我会发生这种情况,因为如果不定义要滚动的列表视图,您就无法在其他滚动中滚动,因此您需要放置高度和宽度

要解决这个问题,请将您的列表视图放在这样的 Sizedbox 中

 ListView(
          children: <Widget>[
            SizedBox(
            height: 150,
            width: 150,
          child: ListView(
            children: <Widget>[],
          ),
        )
          ],
        ),

希望对你有帮助

【讨论】:

    【解决方案2】:

    这主要是由于没有给容器或列表视图指定高度。请检查您的代码是否相同。

    【讨论】:

      猜你喜欢
      • 2019-05-25
      • 2021-08-15
      • 2019-11-11
      • 1970-01-01
      • 2018-09-06
      • 2021-09-21
      • 2020-07-19
      • 2018-12-17
      • 2020-04-22
      相关资源
      最近更新 更多