项目作者: chagasaway

项目描述 :
:curly_loop: Simple looped fading slides carousel for React Native.
高级语言: JavaScript
项目地址: git://github.com/chagasaway/react-native-fading-slides.git
创建时间: 2015-10-11T04:08:12Z
项目社区:https://github.com/chagasaway/react-native-fading-slides

开源协议:MIT License

下载


React Native FadingSlides Component

DeepScan Grade

Simple looped fading slides carousel for React Native.

alt tag

Installation

  1. npm install --save react-native-fading-slides

Properties

  1. fadeDuration={500} // Milliseconds for slide fade
  2. stillDuration={1000} // Milliseconds for slide still
  3. height={1000} // Set the slides component height
  4. slides={slidesList} // Set the slides list
  5. startAnimation={true} // Start or stops animation

Slides Properties

  1. title={"Title"} // Slide's title
  2. titleColor={"#fff"} // Slide's title color
  3. subtitle={"Subtitle"} // Slide's subtitle
  4. subtitleColor={"#fff"} // Slide's subtitle color
  5. image={require('image!filename')} // Slide's image
  6. imageWidth={1000} // Slide's image width
  7. imageHeight={1000} // Slide's image height

Usage Example

  1. import FadingSlides from 'react-native-fading-slides';
  2. const slides = [
  3. {
  4. image: require('image!squared-image'),
  5. imageWidth: 100,
  6. imageHeight: 100,
  7. title: 'Hello World',
  8. subtitle: 'This is a beautiful world',
  9. titleColor: '#fff',
  10. subtitleColor: '#fff',
  11. },
  12. {
  13. image: require('image!wide-image'),
  14. imageWidth: 200,
  15. imageHeight: 100,
  16. title: 'Bye World',
  17. subtitle: 'This is a see you soon',
  18. titleColor: '#fff',
  19. subtitleColor: '#fff',
  20. }
  21. ];
  22. //...
  23. render() {
  24. return (
  25. <View>
  26. <FadingSlides
  27. slides={slides}
  28. fadeDuration={1200}
  29. stillDuration={2000}
  30. height={500}
  31. startAnimation={true}
  32. ></FadingSlides>
  33. </View>
  34. );
  35. };