Last active
October 12, 2022 06:22
-
-
Save bastionkid/13f96f3cdda00d0210827b5f39eddfdf to your computer and use it in GitHub Desktop.
Center Aligned Text composable with Modifier.wrapContentHeight()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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