代码(单页):
import React, { Component } from 'react'; import { StyleSheet, Text, View, FlatList, RefreshControl, ActivityIndicator, } from 'react-native'; type Props = {}; const CITY_NAMES = ['北京', '上海', '广州','杭州', '苏州']; export default class FlatListDemo extends Component<Props> { static navigationOptions = { title: 'FlatListDemo', }; constructor(props) { super(props); this.state = { isLoading: false,//初始化的状态,此时加载状态为不加载 dataArray: CITY_NAMES//初始数据 } } loadData=(refreshing)=>{