BOTTOM OVERFLOWED BY 17 PIXELS
这是由于页面高度写死导致的,
1.scaffold 根布局添加 resizeToAvoidBottomPadding:false 是否自动调整body属性控件的大小,以避免脚手架底部被覆盖。例如,如果在脚手架上方显示屏幕键盘,则可调整body属性控件的大小以避免被键盘覆盖。如果你不需要此功能,可以将resizeToAvoidBottomPadding属性设置为false
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomPadding: false,
appBar: AppBar(
title: Text(
'选课',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black54),
),
centerTitle: true,
.....
- body中使用listview包括写死的布局
body: ListView(
shrinkWrap: true,///根据子组件的总长度来设置 ListView 的长度
children: <Widget>[
Container(
alignment: AlignmentDirectional.center,
child: Padding(
padding: EdgeInsets.fromLTRB(30.0, 32.0, 30.0, 0),
child: Column(
children: <Widget>[
Image(
image: AssetImage("images/course_logo.png"),
width: 139,
height: 38,
fit: BoxFit.contain,
),
inputPhone(context),
inputPassword(context),
loginWidget(context),
loginByWX(context),
],
),
)),
],
));