Repository navigation
Can I make the bottom sheet slide in from somewhere that is not the screen edge? #2587
Replies: 1 comment
|
Yes. Pass the footer height as In v5 the sheet lives in a hosting container that is For a dynamic footer, measure it and feed the value in: const [footerHeight, setFooterHeight] = useState(0);
return (
<View style={{ flex: 1 }}>
{/* screen content */}
<BottomSheet
ref={sheetRef}
index={-1}
snapPoints={['40%', '80%']}
bottomInset={footerHeight}
>
<BottomSheetView>{/* ... */}</BottomSheetView>
</BottomSheet>
<View
style={{ position: 'absolute', left: 0, right: 0, bottom: 0 }}
onLayout={(e) => setFooterHeight(e.nativeEvent.layout.height)}
>
<Footer />
</View>
</View>
);Render the footer after the sheet (or give it a higher If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I have a footer at the bottom of my app that I don't want to be overlayed by the bottom sheet. I can let slide in underneath it, but my footer has a dynamic height and can be quite tall, so in that case you start feeling a delay as a user because you have to wait for the bottom sheet to travel below the footer first before it starts appearing. Can I somehow achieve that it just sees this top edge of my footer as its starting point, as if this was the screen edge?
All reactions