📜  在 activityindicator 中制作动画 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:57.778000             🧑  作者: Mango

代码示例1
import React, { Component } from 'react';
import {
  Text,
  View,
  StyleSheet,
  TextInput,
  TouchableHighlight,
  ActivityIndicator
} from 'react-native';

export class Login extends Component {

    constructor(props) {
        super(props);

        this.state = {
            showProgress: false
        };
    }

    render() {
        return (
            

                
                    progressOff
                

                
                    progressOn
                

                
            
        );
    }

    progressOff() {
        this.setState({showProgress: false}); 
    }

    progressOn() {
        this.setState({showProgress: true});
    }
}