I'm trying to create a custom TextField using Android Jetpack compose, see below
TextFieldDefaults.OutlinedTextFieldDecorationBox(
contentPadding = PaddingValues(vertical = 10.dp),
value = searchText,
innerTextField = innerTextField,
enabled = enabled,
singleLine = singleLine,
visualTransformation = VisualTransformation.None,
interactionSource = interactionSource,
colors = textFieldColors,
leadingIcon = {
Icon(
modifier = Modifier.size(leadingIconSize),
painter = painterResource(id = R.drawable.ic_search),
contentDescription = ""
)
},
placeholder = {
Text("what is doin ")
}
)
The height of the text field should be 36dp due to design requirements, however the text field has its own height about 56dp.
I could not find any information how to customize that value so I used the parameter contentPadding
to achieve the goal.
However, it seems too ugly for me. Is there any other way to achieve to implement this?
Thanks in advance.