【发布时间】:2020-10-11 02:19:12
【问题描述】:
我有问题。我创建了一个 TextFormField。当文本长度如此之长时,我希望 textField 将显示为下图。帮我。谢谢。
这是代码:
TextFormField(
controller: nameController,
enabled: false,
textInputAction: TextInputAction.next,
keyboardType: TextInputType.emailAddress,
style: TextUtil.regularArial.copyWith(
fontSize: ScreenUtil.getInstance().setSp(14),
color: ColorUtil.grey8E8E8E,
),
decoration: InputDecoration(
fillColor: Colors.white,
filled: true,
isDense: true,
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
borderSide: BorderSide(color: Colors.white, width: 1),
),
hintText: "Email",
hintStyle: TextUtil.regularArial.copyWith(
fontSize: ScreenUtil.getInstance().setSp(14),
color: ColorUtil.grey7A7A7A,
),
),
validator: (value){
},
),
【问题讨论】:
-
到目前为止您尝试过什么?请分享代码
-
您可以在带有溢出的文本中实现此目的:省略号属性。您也可以在下面尝试@youOne 的回答。看看这个:stackoverflow.com/questions/44579918/…
-
我在帖子中更新了我的代码。