【发布时间】:2021-09-13 15:37:13
【问题描述】:
使用 Jetpack Compose,我正在尝试使用 LazyListScope.items(..) 获取 items List。
val messages: List<Message> = ...
LazyColumn {
items(items = messages) { message ->
MessageCard(message)
}
}
找不到同名的参数:items
The tutorial 没有指定 items 参数名称,但没有它,Kotlin 只会找到需要 count 的 LazyListScope.items(..):
类型不匹配:推断类型是 List 但预期为 Int
【问题讨论】:
标签: kotlin android-jetpack-compose