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

Landscape mode #36

Closed
74io opened this issue Aug 9, 2015 · 13 comments · Fixed by #581
Closed

Landscape mode #36

74io opened this issue Aug 9, 2015 · 13 comments · Fixed by #581
Milestone

Comments

@74io
Copy link

74io commented Aug 9, 2015

Great module! Any pointers on how to get it working when changing the device orientation to landscape?

@rt2zz
Copy link

rt2zz commented Sep 15, 2015

+1 afaik it does not support landscape?

@leecade leecade added this to the v2 milestone Dec 23, 2015
@jasonmerino
Copy link
Contributor

Looks related to #16

@esutton
Copy link

esutton commented Sep 28, 2016

Any suggestions for making react-native-swiper work in landscape mode?

Thanks for a great component!

@GuillaumeMunsch
Copy link

Any news on this ?

@uriklar
Copy link

uriklar commented Jan 1, 2017

+1

@dgurns
Copy link

dgurns commented Feb 8, 2017

+1 too. It works on first load, but dimensions do not update upon rotating device. Even when manually updating Swiper width after device rotation, it doesn't actually update.

@ciriac
Copy link

ciriac commented Apr 10, 2017

+1

@RiusmaX
Copy link

RiusmaX commented Apr 11, 2017

+1 too. I've tried so many ways to force the update after device rotation, like invert width and height, but it's not a good practice at all.

Someone did find a decent solution ?

@timmywil
Copy link

timmywil commented May 3, 2017

The problem is that Swiper gets windows dimensions one time on execute rather than on render, but I've worked around this by getting window dimensions in my render function and passing those values to the width and height props of <Swiper>.

render () {
  const { width, height } = Dimensions.get('window')
  return (
    <Swiper width={width} height={height}>
       ...
    </Swiper>
  )
}

When the window dimensions change, Swiper's componentWillReceiveProps method is called, which updates the dimensions in its state.

@dantman
Copy link

dantman commented May 3, 2017

@timmywil Yup

Though ultimately I don't think Swiper even has a reason to try using the window dimensions to fill the page. It makes much more sense to use flex and onLayout.

@timmywil
Copy link

Seems this broke again when I updated react-native to 0.46.2. componentWillReceiveProps isn't called anymore. This project doesn't seem to be getting support anymore, so I may fork it or just build a custom one for my needs.

timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
timmywil added a commit to timmywil/react-native-swiper that referenced this issue Jul 14, 2017
@SSTPIERRE2
Copy link
Contributor

SSTPIERRE2 commented Aug 3, 2017

@timmywil Does this properly change orientation to landscape now? I've been unable to get that working so far.

@anand-neema
Copy link

Is it working now ?

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

Successfully merging a pull request may close this issue.