怎样让懒加载列表从下面开始显示?
默认情况下,它会从上面开始显示列表。
LazyColumn(){
itemsIndexed(items = chat){ index, chat ->
Column(modifier = Modifier.padding(top = 1.dp, start = 6.dp, bottom = 1.dp, end = 6.dp))
{
if(chat.sender.equals(MyId)){
ItemRigth(chat)
}
else{
ItemLeft(chat)
}
}
}
}
List
提供了一个非常好用的List<T>.reversed()
方法,可以在ViewModel中使用。(只是想补充一下你的答案。)+1 - Some random IT boy