S
S
Stalder2017-09-03 01:54:45
JavaScript
Stalder, 2017-09-03 01:54:45

React Native. ViewPagerAndroid shows no signs of life. How to be?

Can you please tell me why the ViewPagerAndroid component may not work? This question was already raised on the stack, but it crashed there with an error, and the version was old. Now at 0.48 it simply does not respond to this component. Just in case, I'll leave the code below.

export default class StackLearner extends Component {

    render(){
        return (
            <View style={styles.container}>
                <Text>Кроме этой надписи ничего не появляется :с</Text>
                <ViewPagerAndroid style={styles.viewPager} initialPage={0}>
                    <View style={styles.pageStyle}>
                        <Text>First page</Text>
                    </View>
                    <View style={styles.pageStyle}>
                        <Text>Second page</Text>
                    </View>
                </ViewPagerAndroid>
            </View>
        );
    }

}

const styles = StyleSheet.create({
    container: {
        paddingTop: 60,
        alignItems: 'center',
        flex: 1,
    },
    pageStyle: {
        backgroundColor: 'blue',
        alignItems: 'center',
        padding: 20,
        flex: 1,
    },
    viewPager:{
        flex: 1,
    }
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question