简体   繁体   English

删除 Jetpack Compose 中的 BasicTextField 指示灯灯泡?

[英]Remove BasicTextField Indicator Bulb in Jetpack Compose?

Im not sure what this is called so I call it a indicator bulb, its the image thats hanging off of the indicator.我不确定这叫什么,所以我称它为指示灯灯泡,它是悬挂在指示灯上的图像。 It appears above my bottom modal and I think that looks funky, how do we remove this?它出现在我的底部模式上方,我认为这看起来很时髦,我们如何删除它?

带指示灯的图像

底片上有灯泡的图像

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.

相关问题 Jetpack Compose 中可调整大小的 BasicTextField - Resizeable BasicTextField in Jetpack Compose Jetpack Compose 中 BasicTextField 的焦点有多清晰? - How clear focus for BasicTextField in Jetpack Compose? Jetpack Compose:向 BasicTextField 添加字符计数器 - Jetpack Compose: Adding a character counter to BasicTextField Wear OS 上 Jetpack Compose 中的 BasicTextField 问题 - Problem with BasicTextField in Jetpack Compose on Wear OS 如何在 Jetpack 组合 TextField/BasicTextField 中隐藏 cursor? - How to hide cursor in Jetpack compose TextField/BasicTextField? Jetpack Compose 如何在 BasicTextField 中居中提示和输入 - Jetpack Compose how to center hint and input inside BasicTextField 当我专注于 Jetpack Compose 中的 BasicTextField 时,如何禁用软键盘 - How can I disable softKeyboard when I focus on the BasicTextField in Jetpack Compose Android Jetpack Compose BasicTextField 在获得焦点时滚动到顶部,如何停止它 - Android Jetpack Compose BasicTextField scroll to top when get focus, how to stop it 如何在 jetpack compose 中使用 LazyListState 更新 TabRow 指示器? - How to update TabRow Indicator with LazyListState in jetpack compose? 在 BottomSheetScaffold (Jetpack Compose) 中的 BottomSheet 顶部显示可扩展性指示器 - Show indicator of expandability on the top of BottomSheet in BottomSheetScaffold (Jetpack Compose)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM