6

React Native Marquee View

 2 years ago
source link: https://reactnativeexample.com/react-native-marquee-view/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

React Native Marquee View

Help you auto scroll content

demo.gif

Getting started

npm install react-native-marquee-view --save
yarn add react-native-marquee-view

Usage

import MarqueeView from 'react-native-marquee-view';

<MarqueeView
	style={{
		backgroundColor: 'blue',
		width: 200,
	}}>
	<View style={{ backgroundColor: 'red' }}>
		<Text>This is demo content</Text>
	</View>
</MarqueeView>

Properties

Prop Description Default
style View style _
speed Speed 0.1
delay Delay time before start auto scroll animation (ms). 0
autoPlay Auto start when it’s mount true
playing You can put state value to this prop to handle play/stop depend on value _

Method:

  • start: Start animation
  • stop: Reset animation

This package inspired by https://github.com/homielab/react-native-auto-scroll

License

This module is MIT licensed


GitHub

View Github


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK