Recall & Review
beginner Click to reveal answer
What is a LazyColumn in Jetpack Compose?
LazyColumn is a vertically scrolling list that only composes and lays out the visible items, improving performance for long lists.
beginner Click to reveal answer
How do you add items to a LazyColumn?
You use the
items() function inside LazyColumn to provide a list of data and a composable for each item.intermediate Click to reveal answer
Why is LazyColumn preferred over Column for long lists?
Because LazyColumn only creates the visible items, it uses less memory and CPU, making scrolling smooth even with many items.
intermediate Click to reveal answer
What parameter helps LazyColumn remember scroll position?
The
state parameter with a LazyListState object helps remember and control scroll position.beginner Click to reveal answer
How can you add spacing between items in a LazyColumn?
You can add spacing by using the
verticalArrangement = Arrangement.spacedBy(8.dp) parameter inside LazyColumn.What does LazyColumn do differently than a regular Column?
✗ Incorrect
LazyColumn only composes and lays out the items currently visible on screen, unlike Column which composes all children.
Which function is used inside LazyColumn to display a list of data?
✗ Incorrect
The items() function takes a list and a composable lambda to display each item in LazyColumn.
How do you add vertical space between items in LazyColumn?
✗ Incorrect
verticalArrangement = Arrangement.spacedBy() adds consistent vertical spacing between items.
What type of state object helps control scroll position in LazyColumn?
✗ Incorrect
LazyListState is designed to track and control the scroll position of LazyColumn.
Which of these is NOT a benefit of using LazyColumn?
✗ Incorrect
LazyColumn does not sort items; sorting must be done before passing data.
Explain how LazyColumn improves performance when displaying long lists.
Think about what happens when you scroll a long list on your phone.
You got /3 concepts.
Describe how to add a list of strings to a LazyColumn with spacing between items.
Remember the parameters inside LazyColumn and how you display each item.
You got /3 concepts.
