Spot the bug
The list's first item hides under the top bar. Which line is the bug?
@OptIn(ExperimentalMaterial3Api::class)@Composablefun NotesScreen(notes: List<String>) {Scaffold(topBar = { TopAppBar(title = { Text("Notes") }) }) { padding ->LazyColumn {items(notes) { Text(it) }}}}
Hint 1 of 1
What does Scaffold pass to its content?
Choose an answer, then open Show answer below to check it.
Show answer
- Answer: line 5
LazyColumn {
The content ignores the padding that Scaffold provides. Use LazyColumn(contentPadding = padding) or Modifier.padding(padding).