小编ihs*_*lan的帖子

我无法将我的列表添加到lazycolumn。我怎样才能添加

我正在“项目”中添加我的笔记,但出现此错误。我找不到原因,你能帮忙吗?

@Composable
fun NotesList() {
    val notesList = remember { mutableStateListOf<Note>() }
    LazyColumn {
        items(notesList) {note->
            NoteCard(note.title, note.content,note.color,note.liked)
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

当我将光标悬停在 noteList 上时,出现以下错误。

类型不匹配。必需:Int 找到:SnapshotStateList

我希望通过将我的列表添加到项目中可以发挥作用,但事实并非如此。

android-jetpack android-jetpack-compose

5
推荐指数
1
解决办法
967
查看次数