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

Bottom container height without anchor point

Open samiede opened this issue 5 years ago • 9 comments

Hey! First of all, awesome library!

I'm trying to set the hight of the expanded bottom sheet without using an anchor point but I can't seem to find any option to do that. Is it possible to get a prop that sets that?

Best wishes!

samiede avatar Apr 17 '19 11:04 samiede

Hi, thanks for reaching out,

You can set the height of the bottom sheet by manually setting the hight of the inner <View />, like on the SimpleView.js example https://github.com/cesardeazevedo/react-native-bottom-sheet-behavior/blob/master/example/views/SimpleView.js#L105

Let me know if you got it.

cesardeazevedo avatar Apr 17 '19 13:04 cesardeazevedo

Thanks for the answer! Yes, that works! I'm aware this might be suitable for another issue, but what I'm essentially trying to do is recreating the maps example but with the BottomContentHeader when I'm in the expanded view because I need to have another navigation once I'm in expanded view to control the ScrollView inside the container. Since using ScrollView only works when either not using the anchor point or when using the MergedAppBar (at least from what I understood of the library so far), I need to implement a custom design for the MergedAppBar, which is not possible. My idea now would be to set the height of the Content to the screen height once the User scrolls higher than the expanded position. Maybe you know another way of achieving this?

Thank you very much!

samiede avatar Apr 17 '19 14:04 samiede

I think i am really confused now 😅, do you have a visual example on what you are trying to do?

cesardeazevedo avatar Apr 18 '19 06:04 cesardeazevedo

Yes sure!

I built a navigation that controls the content of a scrollview and of the content container behind the BottomSheetBehaviour. Collapsed it looks like this: 1 I don't need scrolling behaviour when in anchor state, so at the anchor, it should look like this: 2 But in expanded state, I need the navigation, that I put in the Header to be sticking to the top of the screen with a scrollable list below: 3 I know that it is possible to achieve scrolling when using the MergedAppBarLayout, but that merges the top bar and it is not possible to customize the header the way I need it. I tried putting an absolute view on top of the scroll view, but it wouldn't display correctly within the CoordinatorLayout. Thanks for your help! :)

samiede avatar Apr 18 '19 06:04 samiede

I have a better understanding now, thanks for clarify, The MergedAppBarLayout is indeed very hard to customized, i think i did something similar on the past, so let me play around and i will back to you.

cesardeazevedo avatar Apr 18 '19 07:04 cesardeazevedo

Is something like this you're trying to achieve?

test

cesardeazevedo avatar Apr 18 '19 07:04 cesardeazevedo

Yes, something like that, but with the user being to also scroll down in the expanded state! :) Basically, the view has a map in the content area, so the original statusbar with the "Google Maps" text in the example is not needed. The BottomSheetHeader basically serves as navigation to control what is displayed in the content of the BottomSheet behaviour, which is supposed to be accessible once the user reaches expanded state.

samiede avatar Apr 18 '19 07:04 samiede

Yeah indeed, i think it's a bug on the NestedScrollView that i need to investigate further, if you want to play around, i have this gist so far. https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b

cesardeazevedo avatar Apr 18 '19 08:04 cesardeazevedo

I will check it out and let you know if I find something! Thanks for your help though! :)

Am 18.04.2019 um 10:04 schrieb César Augusto [email protected]:

Yeah indeed, i think it's a bug on the NestedScrollView that i need to investigate further, if you want to play around, i have this gist so far. https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b https://gist.github.com/cesardeazevedo/e29b3ef261ba5053b614e52dea40f83b — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cesardeazevedo/react-native-bottom-sheet-behavior/issues/52#issuecomment-484398364, or mute the thread https://github.com/notifications/unsubscribe-auth/ABOFHOTWF3D4UPP5XT54VZTPRATRHANCNFSM4HGTLWMA.

samiede avatar Apr 18 '19 08:04 samiede