12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import React, { Component } from 'react';
- import { StyleSheet, Text, View, ActivityIndicator, Dimensions, Image } from 'react-native';
- const { width, height } = Dimensions.get('window');
- _this = null;
- class Loading extends Component {
- constructor(props) {
- super(props);
- _this = this;
- this.state = {
- show: false
- };
- }
- static show = () => {
- _this.setState({ show: true });
- };
- static hide = () => {
- _this.setState({ show: false });
- };
- render() {
- if (this.state.show) {
- return (
- <View style={styles.LoadingPage}>
- {/* <View
- style={{
- width: 100,
- height: 100,
- backgroundColor: 'rgba(0,0,0,0.6)',
- opacity: 1,
- justifyContent: 'center',
- alignItems: 'center',
- borderRadius: 7
- }}
- >
- <ActivityIndicator size="large" color="#FFF" />
- <Text style={{ marginLeft: 10, color: '#FFF', marginTop: 10 }}>正在加载...</Text> */}
- {/* </View> */}
- <Image source={require('../images/common/loading.gif')} />
- </View>
- );
- } else {
- return <View />;
- }
- }
- }
- export default Loading;
- const styles = StyleSheet.create({
- LoadingPage: {
- position: 'absolute',
- left: 0,
- top: 0,
- backgroundColor: 'rgba(0,0,0,0)',
- width: width,
- height: height,
- justifyContent: 'center',
- alignItems: 'center'
- }
- });
|