繁体   English   中英

无法更改 TextFormField 边框宽度

[英]Not able to change TextFormField Border Width

我正在尝试更改TextFromField边框的宽度,但它不起作用。

下面是我的代码。

TextFormField(
   decoration: InputDecoration(
                border: OutlineInputBorder(
                borderSide: new BorderSide(color: Colors.white,width:2)),
                fillColor: Colors.white,
                labelText: 'Enter your username or email address'
                ),
),

您应该使用enableBorder 尝试这样的事情

TextFormField(
          decoration: InputDecoration(
              enabledBorder: OutlineInputBorder(
                  borderSide: new BorderSide(color: Colors.red, width: 10)),
              fillColor: Colors.white,
              labelText: 'Enter your username'),
        )

参考这里:

InputDecorarion Class 文档

BorderSide Class 文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM