id | title |
---|---|
activityindicator |
ActivityIndicator |
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
Displays a circular loading indicator.
import React from 'react';
import {ActivityIndicator, StyleSheet, View} from 'react-native';
const App = () => (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
horizontal: {
flexDirection: 'row',
justifyContent: 'space-around',
padding: 10,
},
});
export default App;
import React, {Component} from 'react';
import {ActivityIndicator, StyleSheet, View} from 'react-native';
class App extends Component {
render() {
return (
<View style={[styles.container, styles.horizontal]}>
<ActivityIndicator />
<ActivityIndicator size="large" />
<ActivityIndicator size="small" color="#0000ff" />
<ActivityIndicator size="large" color="#00ff00" />
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
},
horizontal: {
flexDirection: 'row',
justifyContent: 'space-around',
padding: 10,
},
});
export default App;
Inherits View Props.
Whether to show the indicator (true
) or hide it (false
).
Type | Default |
---|---|
bool | true |
The foreground color of the spinner.
Type | Default |
---|---|
color | null (system accent default color)Android <ins style={{background: '#999'}} className="color-box" /> '#999999' iOS |
Whether the indicator should hide when not animating.
Type | Default |
---|---|
bool | true |
Size of the indicator.
Type | Default |
---|---|
enum('small' , 'large' )number Android |
'small' |