swiftui list - snap scrolling

Viewed 280

i have a fullscreen list of element.

    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)

Is possible to snap every cell on top when scrolling? I have no idea how to do this.

Thank you!

0 Answers
Related