济宁市松岳建设机械有限公司网站,中山企业门户网站建设,网站服务器的功能,中职示范校建设验收网站使用的组件名字为 TestField 组件
TestField 配置 占位文字 设置 decoration 属性 InputDecoration 中hintText去掉输入到 输入框的间距 InputDecoration 中contentPadding EdgeInsets.zero去掉边框中的间距 InputDecoration 中 使用 isDense:true设置输入框内文字的颜色 …使用的组件名字为 TestField 组件
TestField 配置 占位文字 设置 decoration 属性 InputDecoration 中hintText去掉输入到 输入框的间距 InputDecoration 中contentPadding EdgeInsets.zero去掉边框中的间距 InputDecoration 中 使用 isDense:true设置输入框内文字的颜色 样式 TextField 中 style文字居中 strutStyle obscureText 设置输入框为密码类型
发现比较全的 属性解说
Flutter输入框TextField属性介绍及相关问题_flutter 密码输入框-CSDN博客 样式如下 完整代码如下 Container(decoration: BoxDecoration(border: Border.all(color: Colors.blue),),child: const TextField(decoration: InputDecoration(hintText: 请输入手机号码,border: InputBorder.none,contentPadding: EdgeInsets.zero,isDense: true,),style: TextStyle(fontSize: 13),strutStyle: StrutStyle(fontSize: 13,leading: 0,height: 1.1,// 1.1更居中forceStrutHeight: true, // 关键属性 强制改为文字高度),textAlign: TextAlign.center,),),