Android compose使文本垂直居中 摘要 仅使用Text()无法垂直居中。需要将Box()与contentAlignment=Alignment一起使用。居中还有用于对齐的CenterStart和CenterEnd选项。 Box( ... 仅使用Text()无法垂直居中。需要将Box()与contentAlignment=Alignment一起使用。居中还有用于对齐的CenterStart和CenterEnd选项。 Box( contentAlignment = Alignment.Center, ) { Text( text = "Text", textAlign = TextAlign.Center ) } 标签:compose