С кодом, указанным в документации Kotlin, я получаю следующую ошибку при реализации Textfield: < /p>
val state = rememberTextFieldState("Initial text", TextRange(0, 12))
TextField(
state = state,
lineLimits = TextFieldLineLimits.SingleLine,
label = { Text("Label") },
)
Ни один из следующих кандидатов не применимо:
fun TextField(value: TextFieldValue, onValueChange: (TextFieldValue) -> Unit, modifier: Modifier = ..., enabled: Boolean = ..., readOnly: Boolean = ..., textStyle: TextStyle = ..., label: @Composable() (() -> Unit)? = ..., placeholder: @Composable() (() -> Unit)? = ..., leadingIcon: @Composable() (() -> Unit)? = ..., trailingIcon: @Composable() (() -> Unit)? = ..., prefix: @Composable() (() -> Unit)? = ..., suffix: @Composable() (() -> Unit)? = ..., supportingText: @Composable() (() -> Unit)? = ..., isError: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardOptions: KeyboardOptions = ..., keyboardActions: KeyboardActions = ..., singleLine: Boolean = ..., maxLines: Int = ..., minLines: Int = ..., interactionSource: MutableInteractionSource? = ..., shape: Shape = ..., colors: TextFieldColors = ...): Unit
fun TextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = ..., enabled: Boolean = ..., readOnly: Boolean = ..., textStyle: TextStyle = ..., label: @Composable() (() -> Unit)? = ..., placeholder: @Composable() (() -> Unit)? = ..., leadingIcon: @Composable() (() -> Unit)? = ..., trailingIcon: @Composable() (() -> Unit)? = ..., prefix: @Composable() (() -> Unit)? = ..., suffix: @Composable() (() -> Unit)? = ..., supportingText: @Composable() (() -> Unit)? = ..., isError: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardOptions: KeyboardOptions = ..., keyboardActions: KeyboardActions = ..., singleLine: Boolean = ..., maxLines: Int = ..., minLines: Int = ..., interactionSource: MutableInteractionSource? = ..., shape: Shape = ..., colors: TextFieldColors = ...): Unit
Подробнее здесь: https://stackoverflow.com/questions/796 ... ck-compose