LoadingView.js 1.28 KB
/**
 * Created by Cassie on 2018/05/14
 */
import React, {Component} from 'react';
import {
    ActivityIndicator,
    StyleSheet,
    Text,
    View
} from 'react-native';
import {scaleHeight, scaleSize, setSpText} from "../utils/ScreenUtil";

export default class LoadingView extends Component {


    constructor(props){
        super(props);
    };

    render(){
        return(
            <View style={styles.loadingBg}>
                <View style={styles.loadingBox}>
                    <ActivityIndicator size="large" color="#fff"/>
                    <Text
                        style={{fontSize: setSpText(16), color: '#ffffff', marginTop: scaleHeight(6)}}
                    >
                        加载中...
                    </Text>
                </View>
            </View>
        )
    }
}


const styles = StyleSheet.create({
    loadingBg: {
        position: "absolute",
        top: 0,
        width: "100%",
        height: "100%",
        display: "flex",
        justifyContent: "center",
        alignItems: "center"
    },
    loadingBox: {
        width:scaleSize(120),
        height: scaleHeight(120),
        backgroundColor: "rgba(0,0,0,.5)",
        borderRadius: 8,
        display: "flex",
        alignItems: "center",
        justifyContent: "center"
    },
});