Mayank Saini
06/08/2021, 5:48 AMplaceholder
and leadingIcon
are not properly aligned. placeholder
is aligned to the top while the leadingIcon
is in centre. I want both of them to be in centre. What is the solution for this?tad
06/08/2021, 6:05 AMoffset
or paddingFromBaseline
modifiers, but I would check it against text with descenders.Mayank Saini
06/08/2021, 6:14 AMTextField
, the text is not in centre, it has extra padding from bottom.Mayank Saini
06/08/2021, 6:18 AMProvideTextStyle(
value = MaterialTheme.typography.body2.copy(
color = MaterialTheme.colors.primary,
textAlign = TextAlign.Start
)
) {
TextField(
modifier = Modifier
.fillMaxWidth(),
value = field,
onValueChange = {
changeField(it)
},
maxLines = 1,
placeholder = placeHolder,
leadingIcon = leadingIcon,
trailingIcon = trailingIcon,
colors = TextFieldDefaults.textFieldColors(
textColor = MaterialTheme.colors.primary,
backgroundColor = Color.Transparent,
focusedIndicatorColor = Color.Transparent,
unfocusedIndicatorColor = Color.Transparent,
disabledIndicatorColor = Color.Transparent
),
)
}
This is my code