Greg Rami
10/09/2024, 4:53 PMTy
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 threadGreg Rami
10/09/2024, 4:53 PMTextField(
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),
)