There are vertical paddings of Text Composable as you can see below
To remove vertical paddings of Text, I tried to modify my code, but not working.
Text(
text = "2",
fontSize = 100.sp,
==================
Case 1.
modifier = Modifier.padding(0.dp), ## First thing I tried, but not working.
==================
Case 2.
style = LocalTextStyle.current.merge( ## Second, but also not working.
TextStyle(
fontSize = 100.sp,
// lineHeight = 2.5.em,
lineHeightStyle = LineHeightStyle(
alignment = LineHeightStyle.Alignment.Bottom,
trim = LineHeightStyle.Trim.LastLineBottom,
),
),
)
) // The end of the Text()
Those cases are not working.
I want to remove paddings of that Text Composable, and result in having padding 0.
======Edited======
Also, I test in @Preview function
@Preview
@Composable
fun PreviewText100sp() {
Text(
"100",
fontSize = 100.sp
)
}
But, still it seems like Text() have vertical paddings like below.