我为AutoSizeTextField
设置的labeltext
域不够。有没有办法做多行?
AutoSizeTextField(
...
style: TextStyle(
fontSize: 22, color: Colors.black),
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
),
labelText: AppLocalizations.of(context)
.translate('total_spent'),
labelStyle: TextStyle(
fontSize: 22, color: Colors.black,),
hintText: spent.toString(),
contentPadding: const EdgeInsets.all(10.0),
...
1条答案
按热度按时间cyej8jka1#
labelText
size取决于AutoSizeTextField
的字体大小,如果我们不指定labelStyle
的字体大小。您可以通过减少
labelStyle
上的fontSize
或使用\n
、label\ntext
分隔命中文本来解决此问题。或者提供足够的宽度给
AutoSizeTextField
。