n4kz / react-native-pages

Easy to use page view component
Other
376 stars 83 forks source link

Android (Indicator not tally) #23

Closed nzrin closed 4 years ago

nzrin commented 6 years ago

It seems indicator on android not tally when I tried to swipe left or right.

supr-d commented 6 years ago

I have the same issue on Android (react-native-pages@0.7.0). Also, the transition from one screen to another is too abrupt on Android.

supr-d commented 6 years ago

Here it is (look at the indicator): react-native-pages At the end of the record you can see abrupt animation when switching from green square to blue. On the real Android device this happens more often. A render method looks like this:

render() {
    return (
        <View style={{ flex: 1 }}>
            <Pages containerStyle={{ backgroundColor: '#159eda' }}>
                {['red', 'green', 'blue'].map(color => this.renderPage(color))}
            </Pages>
            <ButtonBack />
        </View>
    );
}
ali-shabani commented 6 years ago

I have the same issue

nicolas-rohricht commented 5 years ago

I was having the same problem.

After some tests, I discovered that to PageControll works well, our Content must be inside of a View with flex and background style property set.

In my example, I would like to render 3 pages. Te result is:

<Pages indicatorColor={'#a6a6a6'} startPage={0}> <View style={{ flex: 1, backgroundColor: 'transparent' }}> { RenderMyContent } <View style={{ flex: 1, backgroundColor: 'transparent' }}> { RenderMyContent } <View style={{ flex: 1, backgroundColor: 'transparent' }}> { RenderMyContent }

Hope this can help you.

n4kz commented 4 years ago

Thanks for issue and sorry for delayed reply. Starting from 0.8.0 backgroundColor hack is not needed anymore, as I've added collapsable: false prop to all child components.