活动指示器
<ActivityIndicator />
属性
animating:{true/false} 是否显示
size:''large/small" 圆圈大小
color:'颜色'
style:设置其他样式,其中{height和width为定位}
按钮
<Button title='设置按钮文本内容'></Button>
代码示例:
import React,{Component} from 'react'
import {ActivityIndicator,View,Text,TouchableOpacity,Button,StyleSheet} from 'react-native'
export default class Act extends Component{
state={
flag:true
}
close=function(){
this.setState({
flag:!this.state.flag
})
}
componentDidMount=()=>this.close()
render(){
return(
<>
<ActivityIndicator
animating={this.state.flag}
color='red'
//small
size='large'
style={style.act}
/>
<Button onPress={this.close.bind(this)} title='开关'></Button>
</>
)
}
}
const style=StyleSheet.create({
act:{
height:60,
width:80
}
})