[英]How to change icon cursor of Textfield in Flutter?
textSelectionHandleColor
已弃用,不应使用。 请改用TextSelectionThemeData.selectionHandleColor
。
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
...
textSelectionTheme: TextSelectionThemeData(selectionHandleColor: Colors.black),
...
);
}
TextField(
cursorColor: Colors.pink,
)
您的意思是处理程序选择器,而不是cursor ,对吗?
你可以使用textSelectionHandleColor
在应用程序的根目录中使用 textSelectionHandleColor 应用该更改。
我认为单个TextField
不可能
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
textSelectionColor: Colors.yellow,
textSelectionHandleColor: Colors.red)
);
}
ThemeData(
textSelectionTheme: TextSelectionThemeData(
cursorColor: pink,
selectionHandleColor: pink,
selectionColor: pink
)
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.