ベースラインによってa 内の要素を整列する方法Row
。私の問題は、Row
複数Text
の要素を持つ要素が必要であり、各要素のText
フォントとサイズが異なることです。デフォルトでは、それらは上に配置されます。それらを下に揃える必要があります。これはコードです:
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)
)
}
}
}
}
}
コードのレンダリング ビューを次に示します。