Skip to content

Instantly share code, notes, and snippets.

@bastionkid
Last active October 12, 2022 06:22
Show Gist options
  • Save bastionkid/13f96f3cdda00d0210827b5f39eddfdf to your computer and use it in GitHub Desktop.
Save bastionkid/13f96f3cdda00d0210827b5f39eddfdf to your computer and use it in GitHub Desktop.
Center Aligned Text composable with Modifier.wrapContentHeight()
fun CenterAlignedText() {
Text(
text = "Center",
textAlign = TextAlign.Center,
modifier = Modifier.size(100.dp)
.background(Color.Cyan)
.wrapContentHeight(),
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment