
如何在顫動的TextFormField中洗掉前綴圖示后的空格?我已經嘗試過 isCollapsed = true,isDense = true。我已經設定了我的 contentPadding:EdgeInsets.all(0)。然而,使用 prefix 而不是 prefixIcon 解決了我的問題,但還有另一個問題。前綴僅出現在焦點上。如何解決我的問題?我想前綴(或prefixIcon)在開始時始終可見。并且TextFormField 的文本必須像前綴的continue。
uj5u.com熱心網友回復:
檢查下面的代碼:它完美地作業:
TextField(
decoration: InputDecoration(
// choose any icon of your choice here
prefixIcon: Icon(Icons.person),
// set the prefix icon constraints
prefixIconConstraints: BoxConstraints(
minWidth: 25,
minHeight: 25,
),
),
),
uj5u.com熱心網友回復:
試試這個
TextFormField(
decoration: const InputDecoration(
prefixIcon: Text("118"),
prefixIconConstraints: BoxConstraints(maxWidth: 40)),
)
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/420276.html
標籤:
