分平台的:ProgressBarAndroid、ProgressViewIOS
ProgressBar组件的属性:
styleAttr:进度条的样式,Horizontal Small Large Inverse SmallInverse LargeInverseprogress:当前的进度值(在0到1之间)
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
PixelRatio,
Text,
Image,
TouchableOpacity,
ProgressBarAndroid,
View
} from 'react-native';
class RNAPP extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={[styles.flex, {marginTop:45}]}>
<Text>ProgressBar组件</Text>
<ProgressBarAndroid styleAttr="Horizontal" />
</View>
);
}
}
const styles = StyleSheet.create({
flex:{
flex:1,
},
});
AppRegistry.registerComponent('RNAPP', () => RNAPP);