Flutter 如何在颤振中启用TextField多行的hintText?
由于[InputDecorator]的默认值[maxLines]为1,所以当hintText有时有点长时,我找不到任何方法来启用多行 在颤振中,Textfield已打开hintTextFlutter 如何在颤振中启用TextField多行的hintText?,flutter,Flutter,由于[InputDecorator]的默认值[maxLines]为1,所以当hintText有时有点长时,我找不到任何方法来启用多行 在颤振中,Textfield已打开hintText new TextFormField( controller: inputBoxController, decoration: InputDecoration( labelText: inputBoxName, hintTex
new TextFormField(
controller: inputBoxController,
decoration: InputDecoration(
labelText: inputBoxName,
hintText: inputBoxName,
),
validator: (val) => val.isEmpty ? msg : null,
onSaved: (val) => val,
),
只需设置
hintMaxLines:2
或在输入装饰
选项中需要多少行即可
TextField(
decoration: InputDecoration(
hintMaxLines: 2
)
);
谢谢,在多行文本字段上工作得很好:`textfield(装饰:new input装饰(border:InputBorder.none,hintmaxline:3,hintText:'My veeeeeery veeeeeery large hint text'),键盘类型:TextInputType.multiline,maxLines:null,)`