纵向超出了边界,界面显示不下了
解决方案:只要在超出的外层包裹一个SingleChildScrollView小部件就可以了
Widget build(BuildContext context) {
return Container(
child: Scaffold(
appBar: AppBar(title: Text('登录页'),),
body:SingleChildScrollView(
child: Container(
child: Column(
children: <Widget>[
TextField(
controller:typeController,
decoration:InputDecoration (
contentPadding: EdgeInsets.all(10.0),
labelText: '密码',
helperText: '请输入密码'
),
autofocus: false,
),
Text(
showText,
overflow:TextOverflow.ellipsis,
maxLines: 2,
),
],
),
)
)
),
);
}