https://kotlinlang.org logo
#compose
Title
# compose
c

Chris Fillmore

11/30/2021, 11:09 PM
Is it possible to position an element on a bottom sheet so that it always sits on the bottom of the screen, regardless of whether the sheet is in
HalfExpanded
or
Expanded
state? In particular, what I observe is that when the bottom sheet content is more than 50% of the screen height, and the bottom sheet is
HalfExpanded
, then the element is positioned below the bottom of the screen (not visible). If I drag it to
Expanded
state, then the positioned element becomes visible. For example:
Copy code
// I'm using bottom sheet navigation
bottomSheet(...) {
  Box {
    Column {
      // Some content here
    }
    Row(
      // Alignment from BoxScope
      modifier = Modifier.align(Alignment.BottomCenter)
    ) {
      // I have some buttons I want to put here that will remain at the bottom of the screen while the bottom sheet is open
    }
  }
}
My question is perhaps better phrased as: Is it possible to have an element sized to the visible portion of a bottom sheet? (Then I could just position an element as I want to within)
5 Views