I have Row
with two components, Text
and Switch
, after adding the Switch
, I see the space above and below. I want the heigh of Switch
is fit to UI height.
I use padding(0.dp)
but it is not working.
How to remove that?
This is my code:
Row(
modifier = Modifier
.fillMaxWidth()
.background(color = Color.Red),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "This is a text",
modifier = Modifier.background(color = Color.Yellow)
)
Switch(
checked = false,
onCheckedChange = {},
modifier = Modifier
.padding(0.dp)
.background(color = Color.Blue)
)
}