Complete the code to set the vertical arrangement of a Column to center.
Column(
verticalArrangement = Arrangement.[1]
) {
Text("Hello")
}Using Arrangement.Center centers the children vertically inside the Column.
Complete the code to align the content of a Row horizontally to the end.
Row(
horizontalArrangement = Arrangement.[1]
) {
Button(onClick = {}) { Text("Click") }
}Arrangement.End aligns the children to the right end horizontally in a Row.
Fix the error in the code by choosing the correct alignment for a Box content.
Box(
contentAlignment = Alignment.[1]
) {
Text("Centered Text")
}Alignment.Center centers the content inside the Box both vertically and horizontally.
Fill both blanks to create a Column with horizontal alignment to center and vertical arrangement spaced evenly.
Column(
horizontalAlignment = Alignment.[1],
verticalArrangement = Arrangement.[2]
) {
Text("Item 1")
Text("Item 2")
}Alignment.Center centers children horizontally, and Arrangement.SpaceEvenly spaces children evenly vertically.
Fill all three blanks to create a Row with vertical alignment to bottom, horizontal arrangement spaced between, and content aligned to bottom end.
Row(
verticalAlignment = Alignment.[1],
horizontalArrangement = Arrangement.[2],
modifier = Modifier.fillMaxWidth()
) {
Box(
modifier = Modifier.weight(1f),
contentAlignment = Alignment.[3]
) {
Text("End")
}
}verticalAlignment = Alignment.Bottom aligns children to bottom vertically, horizontalArrangement = Arrangement.SpaceBetween spaces children horizontally with space between, and contentAlignment = Alignment.BottomEnd aligns content inside Box to bottom end.