cha*_*yan 2 uitextfield flutter-layout
我需要文本字段应该垂直扩展到 5 按下回车键
第 5 次输入后,其他行应包含在滚动条内
如何使用颤振实现我需要的文本字段
现在我在文本字段中设置了 maxlines: null
谢谢你们的建议,但我通过下面的代码找到了实际的文本字段
Flexible(
child: new ConstrainedBox(
constraints: new BoxConstraints(
minWidth: size.width,
maxWidth: size.width,
minHeight: 25.0,
maxHeight: 135.0,
),
child: new Scrollbar(
child: new TextField(
cursorColor: Colors.red,
keyboardType: TextInputType.multiline,
maxLines: null,
controller: tc,
_handleSubmitted : null,
decoration: InputDecoration(
border: InputBorder.none,
contentPadding: EdgeInsets.only(
top: 2.0,
left: 13.0,
right: 13.0,
bottom: 2.0),
hintText: "Type your message",
hintStyle: TextStyle(
color:Colors.grey,
),
),
),
),
),
),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1130 次 |
| 最近记录: |