我正在尝试将TextField添加到对话框中,但是当键盘出现时,它会产生溢出。
我的对话形象

当键盘出现时

在这里,我的代码是什么样子的:
AlertDialog(
content: new ListView(
shrinkWrap: true,
children: <Widget>[
Text(
"How Would You Rate Our App?",
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
)发布于 2019-04-02 08:05:56
您可以简单地使用SingleChildScrollView
AlertDialog(
content: SingleChildScrollView(
scrollDirection: Axis.vertical,
child: Column(
children: <Widget>[
Text(
"How Would You Rate Our App?",
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
]
)
)
)发布于 2020-09-22 12:22:41
问题出现在对话框后面的屏幕上。我面临着同样的问题,但上面没有一个解决方案与我的代码一起工作,所以我使用了以下代码:
resizeToAvoidBottomInset: false,这一行在“返回Scaffold”下面--我在这个页面上找到了这个解决方案
发布于 2020-06-28 09:17:58
AlertDialog(
content: SingleChildScrollView(
child: Column(
children: <Widget>[
Text(
"How Would You Rate Our App?",
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold),
textAlign: TextAlign.center,
),
]
)
)
)https://stackoverflow.com/questions/51498911
复制相似问题