A
A
Alexey Vinogradov2021-04-04 20:03:42
React Native
Alexey Vinogradov, 2021-04-04 20:03:42

How to open Button Sheet by content height?

Hello everyone, I want to make in my application so that the Button Sheet opens according to the content height.
That is, for example, if the content that should be contained in the button Sheet does not exceed the screen height, I want to open it according to the content height.
To implement the bottom sheet, I use the library https://github.com/osdnk /react-native-reanimated-b... there is a snapPoints parameter but I lack knowledge of how I can determine the height of the content content before opening the bottom sheet in order to feed the extreme point into this parameter

Maybe one of you has already implemented this case I will be grateful for any information

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
davidnum95, 2021-04-06
@davidnum95

Short answer: read the height of the content through onLayout. Read more here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question