颤动:键盘溢出My Dialog

问题描述 投票:0回答:1

我试图将TextField添加到Dialog,但是当键盘出现时,它会溢出。 My dialog Image. When the Keyboard shows up

这里我的代码部分如何看起来像:

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,
    )
dart flutter flutter-layout
1个回答
0
投票

你可以简单地使用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,
        ),
        ]
    )
    )
)
© www.soinside.com 2019 - 2024. All rights reserved.