我有一个全屏元素列表。
VStack{
List {
ForEach(books, id: \.id) { book in
Text(book.title)
.background(Color.yellow) // text background
.listRowBackground(Color.blue) // cell background
}
.frame(height: UIScreen.main.bounds.height)
}
}
.background(Color.red)
.edgesIgnoringSafeArea(.all)
当滚动时,是否可以将每个单元格固定在顶部? 我不知道如何做到这一点。
谢谢!
snap
是什么意思?快照吗? - Aleksey Potapov