react-native-reanimated-bottom-sheet icon indicating copy to clipboard operation
react-native-reanimated-bottom-sheet copied to clipboard

Question: How to set appropriate snap point for different screen sizes?

Open rishabhsxn opened this issue 3 years ago • 3 comments

I want to set the snap point of BottomSheet such that it only takes the height of it's content. I tried percentages and device height to achieve the same, but the results are not satisfactory on different screen sizes.

If I try to set appropriate snap point for devices with larger height, some content(lower) of BottomSheet gets hidden on devices with small height. If I try to set appropriate snap point for devices with small height, a lot of empty space is left on BottomSheet on devices with large height.

rishabhsxn avatar Jun 28 '21 07:06 rishabhsxn

Same issue here!

LaurenceM10NS avatar Nov 04 '21 22:11 LaurenceM10NS

You can use onLayout prop of View in order to calculate the height of the content and set snapPoints dynamic based on this!

kostas64 avatar Feb 09 '23 08:02 kostas64

You can use onLayout prop of View in order to calculate the height of the content and set snapPoints dynamic based on this! Good idea, but if the content is inside of the BottomSheet component, the height will not be known initially right?

jonatanramhoj avatar Aug 10 '23 17:08 jonatanramhoj