簡體   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