[英]Remove BasicTextField Indicator Bulb in Jetpack Compose?
You can hide the cursor using cursorBrush = SolidColor(Unspecified)
.您可以使用
cursorBrush = SolidColor(Unspecified)
隐藏 cursor。
You have also to define a custom TextSelectionColors
to override the default color provided by LocalTextSelectionColors.current
that it is applied to the text selection and the TextFieldCursorHandle
.您还必须定义自定义
TextSelectionColors
以覆盖LocalTextSelectionColors.current
提供的默认颜色,该颜色应用于文本选择和TextFieldCursorHandle
。
val customTextSelectionColors = TextSelectionColors(
handleColor = Color.Transparent,
backgroundColor = Color.Transparent
)
CompositionLocalProvider(LocalTextSelectionColors provides customTextSelectionColors) {
BasicTextField(
value = text,
onValueChange = {text = it},
cursorBrush = SolidColor(Unspecified)
)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.