本文介绍了Flutter TextFormField文本在溢出时被隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我达到 TextFormField 的限制时,文本消失了...我尝试了多个配置,但仍然无法正常工作,我找不到原因.

When I reach the limit of the TextFormField the text disapear...I tryed multiple config but still not working, I dont find why.

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'))),
              )),]))))

两个设备上存在相同的问题:

Same problem on two device :

错误字段也以奇怪的方式被隐藏.

And Error field get hidded on strange way too.

展开的位于高度为400的容器中.

The Expanded is in a Container with a height of 400.

推荐答案

您正在将TextFormField的高度从其实际高度减小到较小.通常由于附加填充而发生.尝试找出并删除

You are reducing the height of TextFormField from its actual height to something lesser. It happens normally because of additional padding. try to identify that and remove

这篇关于Flutter TextFormField文本在溢出时被隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 19:16