react-native-swiper icon indicating copy to clipboard operation
react-native-swiper copied to clipboard

Not updating width/height while rotating device

Open arunraj-qburst opened this issue 7 years ago • 4 comments

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

arunraj-qburst avatar Mar 22 '17 14:03 arunraj-qburst

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

michaelknoch avatar Apr 25 '17 12:04 michaelknoch

same issue

j-mendez avatar Jul 24 '17 01:07 j-mendez

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

michaelknoch avatar Jul 24 '17 06:07 michaelknoch

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}
        >

luisfuertes avatar Aug 10 '21 09:08 luisfuertes