React-native-swiper: First slide content not displaying until begin swipe

Created on 6 Jan 2018  路  3Comments  路  Source: leecade/react-native-swiper

iOS using react-navigation

import React, { Component } from 'react';
import { View, Text, ScrollView } from 'react-native';
import Swiper from 'react-native-swiper';

class Activity extends Component {
    render() {
        return (
            <Swiper style={styles.wrapper} showsButtons={false}>
                <View style={styles.slide1}>
                    <Text style={styles.text}>Hello Swiper</Text>
                </View>
                <View style={styles.slide2}>
                    <Text style={styles.text}>Beautiful</Text>
                </View>
            </Swiper>
        );
    }
}

const styles = {
    wrapper: {
        backgroundColor: '#3D396D'
    },
    slide1: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },
    slide2: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },
    text: {
        color: '#fff',
        fontSize: 30
    }
};

export default Activity;

initial render before swipe gesture:

screenshot 2018-01-06 04 47 35

during/after swipe gesture begins:

screenshot 2018-01-06 04 47 48

Most helpful comment

Add to Swiper props removeClippedSubviews={false}

All 3 comments

I have the same problem, get a blank page and waiting spinner when opening the app, but displaying content when changing tab in navigation. Spinner comes back after a few swipes (I use a three page endless swiper)
But only when building the release version.

Does work in debug mode and on Android perfectly ...

Add to Swiper props removeClippedSubviews={false}

I had removeClippedSubviews already set to false. Did not help unfortunately.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wrannaman picture wrannaman  路  3Comments

agzuniverse picture agzuniverse  路  3Comments

kliuj picture kliuj  路  3Comments

ruben-kasaz picture ruben-kasaz  路  3Comments

AndrewSouthpaw picture AndrewSouthpaw  路  3Comments