Shr*_*mal 2 dart flutter flutter-layout
我正在尝试将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,
)
Run Code Online (Sandbox Code Playgroud)
小智 10
问题出在对话框后面的屏幕上。我遇到了同样的问题,但上述解决方案中没有一个适用于我的代码,所以我使用了以下代码:
resizeToAvoidBottomInset: false,
Run Code Online (Sandbox Code Playgroud)
这一行在“返回脚手架”下我在这个页面上找到了这个解决方案
您可以简单地使用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,
),
]
)
)
)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
821 次 |
| 最近记录: |