Coder Social home page Coder Social logo

Comments (6)

cedricavigo avatar cedricavigo commented on July 28, 2024 5

The following solution works fine for me to get the height from native layout property and set the height from state.

<View style={[styles.panel, { height: this.state.bsHeight }]} onLayout={(event) => { this.find_dimesions(event.nativeEvent.layout) }}>

find_dimesions(layout) {
const { x, y, width, height } = layout;
this.setState({
bsHeight: height
})
}

Thanks for your support @roshangm1 and thanks @osdnk for the awesome library.

from react-native-reanimated-bottom-sheet.

roshangm1 avatar roshangm1 commented on July 28, 2024

Are you giving height for the parent inside renderInner ? What is the style for styles.panel in your gist example ?

from react-native-reanimated-bottom-sheet.

cedricavigo avatar cedricavigo commented on July 28, 2024

@roshangm1 - Yes I am setting the height of the panel as screen height. So, the scroll works for the height that we define?

from react-native-reanimated-bottom-sheet.

roshangm1 avatar roshangm1 commented on July 28, 2024

Yes, that might be the case. You can try giving height 100%.

from react-native-reanimated-bottom-sheet.

cedricavigo avatar cedricavigo commented on July 28, 2024

Tried 100%, but the scroll is completely not working. Turns out we have to set the height correctly to view all the content inside the scroll view. But the problem with my usecase is I will be loading the content dynamically and we can't define a height. I will try to find if there is a way to detect the height of a holder programatically and apply that height to the panel. Please suggest If you have any other solution in the meantime.

Thanks @roshangm1

from react-native-reanimated-bottom-sheet.

roshangm1 avatar roshangm1 commented on July 28, 2024

I usually set the height to be the height of the device (from Dimensions api). This results in blank spaces when not enough content however.
@osdnk and @everyone any thoughts on this ?

from react-native-reanimated-bottom-sheet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.