How to align elements inside a Row
by the baseline. My issue is that I want to have a Row
element with multiple Text
elements and each of the Text
elements will have different font and size. By default, they are aligned on the top. I need them to be aligned on the bottom. This is the code:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
Row {
Text(
text = "Abrakadabra",
style = TextStyle(fontSize = 22.sp, fontWeight = FontWeight.Bold)
)
Text(
text = "Abrakadabra",
style = TextStyle(fontSize = 14.sp, fontWeight = FontWeight.Bold)
)
}
}
}
}
}
Here is the rendered view of the code: