React-native-snap-carousel: Do not display images when using Parallax Image.

Created on 17 Oct 2018  路  2Comments  路  Source: meliorence/react-native-snap-carousel

Hello everyone.
I'm having a problem displaying images using ParallaxImage. Please can anyone help me.
The deadline for submitting my project is 30/10/2018.
thank you everyone

nh ch p man hinh 2018-10-17 luc 15 53 17
nh ch p man hinh 2018-10-17 luc 15 53 22
nh ch p man hinh 2018-10-17 luc 15 53 28

`/* @flow */

import React, { Component } from 'react';
import {
View,
StyleSheet,
Text,
} from 'react-native';
import {widthPercentageToDP as wp, heightPercentageToDP as hp} from 'react-native-responsive-screen';
import Carousel,{Pagination, ParallaxImage} from 'react-native-snap-carousel';

export default class Activity extends React.Component {
constructor() {
super()
this.state = {
entries: [
{
title: 'S岷痯 di峄卬 ra',
images: 'tstudents/src/assets/images/1.jpg',
},
{
title: '膼ang di峄卬 ra',
images: 'tstudents/src/assets/images/1.jpg'
},
{
title: '膼茫 di峄卬 ra',
images: 'tstudents/src/assets/images/1.jpg'
},
],
}
}
_renderItem ({item, index}, parallaxProps) {
return (

source={{ uri: item.images }}
style={styles.image}
parallaxFactor={0.4}
{...parallaxProps}
/>

);}
get pagination () {
const { entries, activeSlide } = this.state;
return (
dotsLength={entries.length}
activeDotIndex={activeSlide}
dotStyle={{
width: hp('1%'),
height: hp('1%'),
borderRadius: hp('0.5%'),
marginHorizontal: 8,
backgroundColor: 'black',
marginBottom: hp('2%')
}}
inactiveDotStyle={{

          }}
          inactiveDotOpacity={0.4}
          inactiveDotScale={0.6}
        />
    );
}

render () {
return (
ref={(c) => { this._carousel = c; }}
data={this.state.entries}
renderItem={this._renderItem}
hasParallaxImages={true}
sliderWidth={wp('100%')}
itemWidth={wp('50%')}
inactiveSlideScale={0.8}
inactiveSlideOpacity={0.2}
onSnapToItem={(index) => this.setState({ activeSlide: index })}
hasParallaxImages={true}
firstItem={(this.props, 'index', 1)}
/>
{ this.pagination }

);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
carousel: {
justifyContent: 'center',
backgroundColor: 'red',
},
});
`

contribution? reproduction?

All 2 comments

鈿狅笍 You did not follow the contributing guidelines!

As stated in these:

You need to fill out the issue template completely. This step is mandatory! Not doing so will result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.


Unless you provide a Snack example in which the issue can be reproduced, as well as a complete description of everything you've tried, we won't be able to help you and the thread will be closed.

Closing as no further feedback has been provided.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

krisidmisso picture krisidmisso  路  4Comments

Dr1992 picture Dr1992  路  4Comments

niloufarMakhzani picture niloufarMakhzani  路  4Comments

naffiq picture naffiq  路  5Comments

siderakis picture siderakis  路  3Comments