【发布时间】:2020-12-16 03:17:12
【问题描述】:
我在我的应用程序的许多地方都使用了 SingleChildScrollView,一切都很好。但是,在下面的场景中,当键盘弹出时,它不能滚动到列的底部。
Future<void> _showCupertinoModalBottomSheet() async {
final Size screenSize = MediaQuery.of(context).size;
await showCupertinoModalPopup(
context: context,
builder: (BuildContext context) {
return Container(
height: screenSize.height * 0.8,
color: CupertinoColors.white,
child: Column(
children: <Widget>[
CupertinoTextField(
),
Expanded(
child: SingleChildScrollView(
child: Column(
children: <Widget>[
//List of widgets
],
),
),
),
],
),
);
});
}
不知道为什么它可以滚动但不能滚动到底部,并且有些内容被键盘隐藏了。
感谢任何帮助!
【问题讨论】:
-
我遇到了类似的问题。就我而言,我将
Stateless widget更改为Stateful,问题就消失了