Challenge - 5 Problems
Master of Column and Row Layouts
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate2:00remaining
What is the output of this Column layout code?
Consider this Kotlin Compose code snippet. What will the screen show?
Android Kotlin
Column {
Text("Hello")
Text("World")
}Attempts:
2 left
💡 Hint
Column stacks children vertically, like a list going down.
✗ Incorrect
Column arranges its children vertically. So Text("Hello") is above Text("World").
❓ ui_behavior
intermediate2:00remaining
What happens if you use Row with these Texts?
Look at this Kotlin Compose code. What is the visual result?
Android Kotlin
Row {
Text("Left")
Text("Right")
}Attempts:
2 left
💡 Hint
Row arranges children horizontally, like a row of items.
✗ Incorrect
Row places its children next to each other horizontally, so Left is on the left and Right is on the right.
❓ lifecycle
advanced2:30remaining
What happens if you nest a Row inside a Column?
Given this code, how will the texts be arranged on screen?
Android Kotlin
Column {
Text("Top")
Row {
Text("Left")
Text("Right")
}
Text("Bottom")
}Attempts:
2 left
💡 Hint
Column stacks vertically; Row inside it stacks horizontally.
✗ Incorrect
The Column stacks Top, then the Row with Left and Right horizontally, then Bottom below.
📝 Syntax
advanced2:00remaining
Which option causes a syntax error in this Column layout?
Identify the option that will NOT compile in Kotlin Compose.
Android Kotlin
Column {
Text("One")
Text("Two")
}Attempts:
2 left
💡 Hint
Look for missing or extra parentheses or braces.
✗ Incorrect
Option A is missing a closing parenthesis for Text("Two"), causing a syntax error.
🧠 Conceptual
expert3:00remaining
What is the effect of using Modifier.weight(1f) in a Row?
In this Row, what does Modifier.weight(1f) do to the Text composables?
Android Kotlin
Row {
Text("A", Modifier.weight(1f))
Text("B", Modifier.weight(2f))
}Attempts:
2 left
💡 Hint
Weight controls how much space each child fills proportionally.
✗ Incorrect
Weight divides available space proportionally. Text B with weight 2f gets twice the width of Text A with weight 1f.