標籤:ios react native
UIActivityIndicator的建立(React Native)by 伍雪穎
'use strict';var React = require('react-native');var { AppRegistry, StyleSheet, View, ActivityIndicatorIOS,} = React;class UIActivityIndicator extends React.Component { render() { return ( <View style={styles.bgview}> <ActivityIndicatorIOS animating={true} style={styles.spinner} /> </View> ); }}class SampleApp extends React.Component { render() { return ( <React.NavigatorIOS style={styles.container} initialRoute={{ title: 'My App', component: UIActivityIndicator, }}/> ); }}var styles = React.StyleSheet.create({ container: { flex: 1 }, bgview: { backgroundColor: '#eeeeee', paddingTop: 75, paddingLeft: 10, paddingRight: 10, paddingBottom: 10, }, spinner: {width: 30,},});React.AppRegistry.registerComponent('SampleApp', function() { return SampleApp });
UIActivityIndicator的建立(React Native)