Kevin S
02/14/2025, 2:54 PMStylianos Gakis
02/14/2025, 3:05 PMBox {
Icon(align(CenterStart))
Text("H", Modifier.withoutPlacement())
}
So that if the text font was bigger or smaller, the entire box would be adjusted and the Icon would move along with it.
Hacky but it worked for a similar layout I've had to buildKevin S
02/14/2025, 3:37 PMAlbert Chang
02/14/2025, 4:51 PMAlbert Chang
02/14/2025, 4:52 PMRow {
var textCenter by remember { mutableFloatStateOf(0f) }
Checkbox(
modifier = Modifier.graphicsLayer {
translationY = textCenter - size.height / 2
}
)
Column {
Text(
text = "Label",
onTextLayout = { textCenter = it.size.height / 2f }
)
Text(text = "Description")
}
}
Ahmed
02/15/2025, 12:31 PMSkaldebane
02/15/2025, 9:59 PMStylianos Gakis
02/16/2025, 2:22 AMSkaldebane
02/16/2025, 2:31 AM