Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differing view sizes on orientation change #11

Open
dpyeates opened this issue Jul 23, 2017 · 0 comments
Open

Differing view sizes on orientation change #11

dpyeates opened this issue Jul 23, 2017 · 0 comments

Comments

@dpyeates
Copy link

dpyeates commented Jul 23, 2017

I'm using your directed scroll view in my app and I have a different layout on portrait than I have on landscape.

Portrait is a 2x3 grid of views (1024x1536px) and landscape is a 3x2 grid of views (1536x1024px)

I am configuring the directed scrollview like this:

<ScrollView
  bounces={true}
  bouncesZoom={true}
  maximumZoomScale={2.0}
  minimumZoomScale={this.state.fitScale}
   showsHorizontalScrollIndicator={true}
   showsVerticalScrollIndicator={true}
   style={styles.container}
   contentContainerStyle={[{
     width: this.state.containerWidth,
     height: this.state.containerHeight,
   }]}>
     <ScrollViewChild scrollDirection={'both'}>
       {this.state.isPortrait ? this._renderPortrait() : this._renderLandscape()}
     </ScrollViewChild>
</ScrollView>

Where this.state.containerWidth and ...Height are dynamically changed depending on orientation.

I am finding that the transition doesn't seem to work very well - the scrollview gets offset and its not possible to pan or zoom to get it back into view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant