nick / react-native-carousel

Carousel component for react-native
MIT License
458 stars 107 forks source link

Bug: carousel does not responding to orientation changes #48

Open ts-ign0re opened 8 years ago

ts-ign0re commented 8 years ago

Hi, all i have some troubles with plugin. Video preview for details: http://take.ms/NqnKe

In summary then you change orientation carousel does not change width/height. We have this bug in a few projects.

chromonav commented 8 years ago

react & react native version ? working for me ` import React from 'react' import { View, Text, Image, ScrollView, Component, Dimensions,StyleSheet } from 'react-native' import Icon from 'react-native-vector-icons/MaterialIcons';

let Carousel = require('react-native-carousel') const { width } = Dimensions.get('window')

const PromotionSlider = ({url, ...rest}) => {

return (
    <Carousel
        width={200}
        delay={4000}
        {...rest}
        >
        <View style={styles.container}>
            <Text>Page 2</Text>
        </View>
        <View style={styles.container}>
            <Text>Page 3</Text>
        </View>
    </Carousel>
)

}

export default PromotionSlider

const styles = StyleSheet.create({
    container: {
        height: 200,
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: 'pink',
    }
})`