【发布时间】:2019-11-02 00:26:59
【问题描述】:
这是我正在开发的登录页面的屏幕:
当键盘出现时,提示我有溢出,这似乎是正常的:
在网络上进行了一些研究后,我发现我必须使用SingleChildScrollView 小部件,这样当键盘出现时,我就可以滚动了。从我所见,我不得不将它添加到脚手架的body 属性中。这就是我所做的,它有效:我能够滚动并且没有更多溢出错误消息。
但是:如您所见,显示已被剪切:
有人知道这是从哪里来的吗?
这是我的代码
return Scaffold(
body:
SingleChildScrollView(child:
Container(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
children: <Widget>[
SizedBox(
height: 150,
),
Container(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
children: <Widget>[
tabBarContainer,
SizedBox(
height: 20.0,
),
AnimatedContainer(
duration: Duration(seconds: 1),
padding: EdgeInsets.only(top: 40.0, left: 40.0, right: 40.0),
width: double.infinity,
height: _containerHeight,
decoration: cardDecoration,
child: TabBarView(
children: <Widget>[
LoginForm(),
RegisterForm(),
],
)
),
],
),
)
],
),
)
)
)
);
编辑:我也尝试添加 ConstrainedBox,如 api flutter 网站的示例所示,但它对我没有帮助:/
【问题讨论】:
-
建议:请使用 stackoverflow 自己的图片上传器到 imgur,个人不相信 url shortners,可能是垃圾邮件或更糟
-
哦,对不起。我以为如果我的声望点少于 10,我就无法上传:/