I'm using Compose Multiplatform to render a TextFi...
# compose-ios
g
I'm using Compose Multiplatform to render a TextField with a Placeholder. My placeholder text is cut off on iOS though as you can see below (
Ty
in "Type" is cut off at the bottom on iOS) I intentionally made the background of my TextField Red and the background of my placeholder Green How do I avoid the text being cut off on iOS? I added the Composable code in the comment thread
Here's the code for my TextField:
Copy code
TextField(
            favoritePattern.value,
            onValueChange = { favoritePattern.value = it },
            modifier = modifier.height(52.dp)
                .background(Color.Red, shape = RoundedCornerShape(8.dp)),
            keyboardOptions = KeyboardOptions(
                capitalization = KeyboardCapitalization.Sentences,
                imeAction = ImeAction.Done,
            ),
            keyboardActions = KeyboardActions(
                onDone = { onSubmit() }
            ),
            singleLine = true,
            colors = TextFieldDefaults.textFieldColors(
                backgroundColor = Color.Transparent,
                focusedIndicatorColor = Color.Transparent,
                unfocusedIndicatorColor = Color.Transparent,
            ),
            placeholder = {
                Text(
                    text = stringResource(Res.string.type_answer_here),
                    color = Color.Black.copy(alpha = 0.4f),
                    fontSize = 16.sp,
                    fontWeight = FontWeight.Bold,
                    modifier = Modifier.fillMaxWidth().background(Color.Green.copy(alpha = 0.6f)),
                    textAlign = TextAlign.Center,
                )
            },
            textStyle = TextStyle.Default.copy(
                color = Color.Black,
                fontSize = 16.sp,
                fontWeight = FontWeight.Bold,
            ),
            shape = RoundedCornerShape(8.dp),
        )
115 Views