import React, { Component } from 'react' import { StyleSheet, View, Text, Image, ActivityIndicator } from 'react-native' import { height, width } from './base'; export interface Props { text?: any } export interface State { show?: boolean } export default class LoadingToast extends React.Component { constructor(props) { super(props); } componentDidMount() { } public readonly state: Readonly = { show: false } show = () => { console.log("哈哈哈") this.setState({ show: true }) }; hide = () => { this.setState({ show: false }) }; render() { let { show } = this.state; let { text } = this.props return ( <> { show ? {text ? text : "正在加载"}... : null } ); } } 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", }, })