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

Not updating width/height while rotating device #371

Open
arunraj-qburst opened this issue Mar 22, 2017 · 4 comments
Open

Not updating width/height while rotating device #371

arunraj-qburst opened this issue Mar 22, 2017 · 4 comments

Comments

@arunraj-qburst
Copy link

Hi,
I was trying the orientation change with the swiper and it is not updating properly.
Any help in this regard ?

@michaelknoch
Copy link

michaelknoch commented Apr 25, 2017

is there any fix or a workaround for this issue by now? Experiencing the same problem.
@arunraj-qburst @leecade

@j-mendez
Copy link

same issue

@michaelknoch
Copy link

have you tried passing width from Dimensions.width instead of using flex layout? @jeffreymendez1993

@luisfuertes
Copy link

luisfuertes commented Aug 10, 2021

My solution

const [swiperLayout, setSwiperLayout] = useState({ height: 0, width: 0 })

return (
    <View style={{ flex: 1 } onLayout={e => setSwiperLayout(e.nativeEvent.layout)}>
        <Swiper
          height={swiperLayout.height}
          width={swiperLayout.width}
        >

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

4 participants