/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
ScrollView,
Image,
Text,
View
} from 'react-native';
let Dimensions = require('Dimensions');
let ScreenWidth = Dimensions.get('window').width;
let ScreenHeight = Dimensions.get('window').height;
import ImageData from "./BadgeData.json";
export default class scrollViewTop extends Component {
constructor(props) {
super(props);
this.state = { currentPage: 0 };
}
static defaultProps = {
duration: 1000,
}
componentDidMount() {
this._startTimer();
}
componentWillUnmount() {
// 如果存在this.timer,则使用clearTimeout清空。
// 如果你使用多个timer,那么用多个变量,或者用个数组来保存引用,然后逐个clear
this.timer && clearTimeout(this.timer);
}
render() {
return (
<View style={styles.continer}>
<ScrollView
ref='scrollView'
//水平方向
horizontal={true}
//当值为true时显示滚动条
showsHorizontalScrollIndicator={false}
//当值为true时,滚动条会停在滚动视图的尺寸的整数倍位置。这个可以用在水平分页上
pagingEnabled={true}
//滑动完一贞
&nb