Hello! I'm trying to implement a collapsing toolba...
# compose
c
Hello! I'm trying to implement a collapsing toolbar and I'm stuck on getting my toolbar content to scroll upwards (offscreen) along with my screen content. I've tried setting the offset of the container for the toolbar content to -(
toolbarMaxHeight
) and then adding a spacer of height
toolbarMaxHeight
so it gives the content space to scroll upwards... but I'm ending up with a blank screen. Even though if I look in layout inspector it shows everything is where it's supposed to be. Is there a way to provide space to a composable so that it can be placed above the top of your screen and then allowed to scroll upwards? Code in comments
Copy code
Column(modifier = Modifier
    .alpha(headerTransitionProgress)
    .offset(y = -(headerMaxHeight))
    .verticalScroll(listState)) {
    Spacer(modifier = Modifier.height(headerMaxHeight))
    toolbarContent()
}
My goal is to have the
toolbarContent()
scroll up and down when my screen content is scrolled. (Basically the existing implementation of CollapsingToolbarLayout)
HeaderMaxHeight
is the maxHeight the toolbar can be.