Flutter:渲染活動底部上方溢出了42個像素
Flutter 控件超出異常:A RenderFlex overflowed by 42 pixels on the bottom.
解決方案
1.Scaffold內添加 resizeToAvoidBottomInset 屬性,缺點是軟鍵盤下面的控件被擋住
Scaffold(
resizeToAvoidBottomInset: false, //添加這一行
appBar: AppBar(
title: Text(‘Expenses Tracker’),
),
body: Column(
children: [
… // other widgets
],
),
);
2.SingleChildScrollView滾動性插件作過渡層
Scaffold(
appBar: AppBar(
title: Text(‘Expenses Tracker’),
),
body: SingleChildScrollView(
child: Column(
children: [
… // other widgets
],
),
),
);