[英]TextFormField input text overflow with DropdownButtonFormField, Flutter
[英]Flutter TextFormField text hidded on overflow
当我达到TextFormField的限制时,文本消失了......我尝试了多个配置但仍然无法正常工作,我不知道为什么。
Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6.0)), //this right here
child: Container(
height: 400.0,
child: Column(children: <Widget>[
Expanded(
child: new Align(
alignment: FractionalOffset.center,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(Icons.account_circle, color: Colors.blue),
Text('Test')
])),
),
Expanded(
child: new Padding(
padding: EdgeInsets.only(left: 10, right: 10, top: 10),
child: new Align(
alignment: FractionalOffset.centerLeft,
child: TextFormField(
initialValue: _inputs[0],
onChanged: (text) {
_inputs[0] = text;
checkOkEnabled();
},
autocorrect: false,
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Mme / M',
hintText: 'test'))),
)),]))))
并且错误字段也以奇怪的方式隐藏。
Expanded位于高度为 400 的容器中。
您正在将 TextFormField 的高度从其实际高度降低到较小的高度。 由于额外的填充,它通常会发生。 尝试识别并删除
在InputDecoration
,添加isDense: true
和contentPadding: EdgeInsets.zero
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.