简体   繁体   English

Jetpack Compose LazyList 未正确显示项目

[英]Jetpack Compose LazyList not showing items correctly

world!世界!

I've been playing with Jetpack Compose for a while, and I've had really good results.我玩 Jetpack Compose 已经有一段时间了,我的结果非常好。 However, I found this problem: I have a list of items, and I use a LazyColumn to show them to the user.但是,我发现了这个问题:我有一个项目列表,我使用LazyColumn将它们显示给用户。 But when I scroll up and down, some items are not displayed correctly and they show up like there is no information in them.但是当我向上和向下滚动时,某些项目无法正确显示,并且它们显示出来就像其中没有信息一样。

I don't know if I'm missing something or this behavior will be corrected in the future.我不知道我是否遗漏了什么,或者这种行为将来会得到纠正。

How it looks它看起来如何

My code:我的代码:

LazyColumn(
    modifier = modifier
        .fillMaxHeight(),
) {
    items(expenses, Expense::id) { expense ->
        ExpenseItem(expense = expense, areExpensesSelectable,
            onExpenseLongClick = { onExpenseLongClick?.invoke() },
            onExpenseSelected = { onExpenseSelected?.invoke(it) },
            onExpenseDeselected = { onExpenseDeselected?.invoke(it) })
    }
}

Self response: this was a bug present in Jetpack Compose until fixed in version beta08.自我响应:这是 Jetpack Compose 中存在的一个错误,直到在 beta08 版本中修复。

I hear this bug is fixed in the latest version of Compose.我听说这个错误已在最新版本的 Compose 中修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM