如何解决带有背景的Flutter TextField文本覆盖光标
我的TextField中的文本有背景。但是背景覆盖了光标。这个问题有解决方案吗?这可能是一个错误-光标不应落在文本背景后面。这是下面的TextField的示例:
TextField(
autofocus: true,keyboardType: TextInputType.multiline,maxLines: null,cursorColor: Colors.white,cursorWidth: 3.0,textInputAction: TextInputAction.done,style: TextStyle(
color: Colors.black,background: Paint()
..strokeWidth = 30.0
..color = Colors.white
..style = PaintingStyle.stroke
..strokeJoin = StrokeJoin.round),);
解决方法
我认为在TextField
中使用背景色的方法是装饰。
类似于:
TextField(
decoration: InputDecoration(
fillColor: Colors.red,filled: true,border: OutlineInputBorder()),autofocus: true,keyboardType: TextInputType.multiline,maxLines: null,cursorColor: Colors.blue,cursorWidth: 3.0,textInputAction: TextInputAction.done,style: TextStyle(
color: Colors.black,),
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。