{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
TextSelectionColors |
Represents the colors used for text selection by text and text field components. |
Cmn
|
Unit |
@Composable Disables text selection for its direct or indirect children. |
Cmn
|
Unit |
@Composable Enables text selection for its direct or indirect children. |
Cmn
|
ProvidableCompositionLocal<TextSelectionColors> |
CompositionLocal used to change the |
Cmn
|
@Composable
fun DisableSelection(content: @Composable () -> Unit): Unit
Disables text selection for its direct or indirect children. To use this, simply add this to wrap one or more text composables.
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.text.selection.DisableSelection import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.Text SelectionContainer { Column { Text("Text 1") DisableSelection { Text("Text 2") Text("טקסט 3") } Text("Text 3") } }
@Composable
fun SelectionContainer(
modifier: Modifier = Modifier,
content: @Composable () -> Unit
): Unit
Enables text selection for its direct or indirect children.
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.material.Text SelectionContainer { Column { Text("Text 1") Text("Text 2") Text("טקסט 3") } }
val LocalTextSelectionColors: ProvidableCompositionLocal<TextSelectionColors>
CompositionLocal used to change the TextSelectionColors
used by text and text field components in the hierarchy.