I am new in android jetpack compose i created a list view using lazyColumn that is working fine but my use case is to pin the 5th or Xth element to the top of the screen while other elements will scroll.

1

There are 1 answers

0
Kashif Masood On

You can use stickyheader for this.

LazyColumn() {
     stickyheader {
         //your xth element
     }
     //your rest of the items
}

It will always stick to the top of the lazy column meanwhile rest of the items will be able to scroll underneath it.