Flutter TextFiled换行显示 刺骨的言语ヽ痛彻心扉 2021-07-01 11:05 450阅读 0赞 在Flutter中,TextFiled中一直输入内容的话,会一直向最后显示,只有一行,这样的功能在开发中很少有用到。这时候我们只需要在TextFiled中进行设置。 Container( alignment: Alignment.topLeft, child: TextField( maxLines: 10, onChanged: _textFieldChanged, autofocus: false, decoration: InputDecoration( hintText: "请输入回答", hintMaxLines: 20, border: InputBorder.none, ), obscureText: false, ), ), #### 设置一下`maxLines: 10,`这个参数就成功了。 ####
还没有评论,来说两句吧...