【问题标题】:Bottom Overflowed by infinity pixels How to fix it底部被无限像素溢出 如何修复
【发布时间】:2023-02-03 16:15:23
【问题描述】:

我正在编写一个用于获取输入电子邮件地址的小部件。 但是我得到的错误底部被无限像素溢出了。

这是代码。

return Scaffold(
  body: Column(
    mainAxisSize: MainAxisSize.min,
    children: [
      Container(
          height: space_8,
          decoration: BoxDecoration(
              borderRadius: BorderRadius.circular(space_2),
              color: widgetBackGroundColor
          ),
          child: SizedBox(
            height: space_8,
            child: TextFormField(
              controller: controller,
              keyboardType: TextInputType.emailAddress,
              decoration: InputDecoration(
                hintText: "example@gmail.com",
              ),
            ),
          )
      )
    ],
  ),
);

【问题讨论】:

  • 将 TextFormFiled 包装成 Expanded

标签: flutter


【解决方案1】:

在您的脚手架下尝试:

resizeToAvoidBottomInset: false;

你可以用 SingleChildScrollView 包装你的 Column

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-11-21
    • 2021-11-20
    • 2019-11-26
    • 2018-08-18
    • 2019-10-14
    • 1970-01-01
    • 2021-07-11
    • 2020-09-09
    相关资源
    最近更新 更多