0.1.0 • Published 8 years ago

react-native-LoopAnimation v0.1.0

Weekly downloads
39
License
-
Repository
github
Last release
8 years ago

react-native-LoopAnimation

react-native component that let you loop an image in the background

Example

npm.io

Installation

npm i react-native-LoopAnimation

Example

import LoopAnimation from 'react-native-LoopAnimation.js'
...
render() {
  //you can also use, like source={imgSource}
  const imgSource={uri:'http://www.menucool.com/slider/jsImgSlider/images/image-slider-2.jpg',width:700,height:306};

  return (
    <View style={{flex:1}}>
      {/*this is the background animation */}
      <LoopAnimation source={require('./img/back.jpg')} duration={10000} />
      <View style={{
        flex: 1,
        flexDirection: 'column',
        justifyContent: 'center',
        alignItems: 'center',
      }}>
        {/*Content goes here*/}
        <View style={{width: 200, height: 400, backgroundColor: 'powderblue'}} />
      </View>
    </View>
  );
}

Props

PropDescriptionDefault
sourceThis is the source of the image
durationtime to pass the first image10000ms
stylestyles you want to add to Animated.imageheight: Window.height