当我修改列表中对象的属性时,UI 不会更新
\n我的代码\xef\xbc\x9a
\n @OptIn(ExperimentalFoundationApi::class)\n @Composable\n fun ContactCard(\n ) {\n var stateList = remember {\n mutableStateListOf<ListViewData>()\n }\n viewModel!!.recordRespListLiveData!!.observe(this) { it ->\n it.forEach {\n stateList.add(ListViewData(false, it))\n }\n }\n LazyColumn() {\n stateList.forEachIndexed { index, bean ->\n stickyHeader() {\n Box(Modifier.clickable {\n stateList[index].visible = true\n }) {\n ContactNameCard(bean.data.contact, index)\n }\n }\n items(bean.data.records) { data ->\n if (bean.visible) {\n RecordItemCard(record = data)\n }\n }\n }\n }\n }\nRun Code Online (Sandbox Code Playgroud)\n当我单击框时,可见设置为 true,但 RecordItemCard 不显示\xef\xbc\x8c为什么\xef\xbc\x9f
\nandroid android-jetpack-compose lazycolumn compose-recomposition