raenardev
07/16/2021, 5:25 PM@Composable
fun TextVerticalCenter() {
Row(verticalAlignment = CenterVertically, modifier = Modifier.background(Color.Black)) {
Box(
Modifier
.size(8.dp)
.background(Color.White)
)
Text(text = "Hello", color = Color.White, fontSize = 24.sp)
}
}
If you look at screenshots, you can see that the box is slightly off center to the top (Even when all letters are same height).
It is even more evident when looking at numbers.
Sorry if i missed it while searching slack, but so far it seems that we have to wait for some way to turn off font padding for that:
https://stackoverflow.com/questions/66126551/jetpack-compose-centering-text-without-font-paddingAlbert Chang
07/17/2021, 2:47 AMraenardev
07/19/2021, 10:52 AMAlbert Chang
07/19/2021, 10:54 AM