react-native(리액트 네이티브) component - ActivityIndicator
import React, {Component} from 'react';
import {StyleSheet, Text, View, ActivityIndicator,} from 'react-native';
type Props = {};
export default class App extends Component<Props> {
constructor(props) {
super(props)
this.state = {
animating: false,
}
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<ActivityIndicator animating={true} size="large" color="#0000ff" />
<ActivityIndicator animating={false} size="small" color="#00ff00" />
<ActivityIndicator animating={true} size="large" color="#0000ff" />
<ActivityIndicator animating={this.state.animating} size="small" color="#00ff00" />
<ActivityIndicator
style={[styles.centering, {backgroundColor: 'green'}]}
animating={this.state.animating} size="small" color="#00ff00" />
<ActivityIndicator size="large" color="#0000ff" />
<ActivityIndicator size="small" color="#00ff00" />
<ActivityIndicator
style={[styles.centering, styles.gray]}
color="white"
/>
<ActivityIndicator style={[styles.centering]} />
<ActivityIndicator
animating={this.state.animating}
style={[styles.centering, {backgroundColor: '#eeeeee'}]}
/>
<ActivityIndicator
animating={this.state.animating}
style={[styles.centering, {backgroundColor: 'green'}]}
></ActivityIndicator>
<ActivityIndicator
style={[styles.centering, styles.gray]}
size="large"
color="white"
/>
<ActivityIndicator
style={[styles.centering, {transform: [{scale: 1.5}] }]}
size="large"
/>
<ActivityIndicator
style={styles.centering}
size={75}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
centering: {
alignItems: 'center',
justifyContent: 'center',
padding: 8,
},
gray: {
backgroundColor: '#cccccc',
},
horizontal: {
flexDirection: 'row',
justifyContent: 'space-around',
padding: 8,
},
});
'프로그래밍(Programming) > 리액트 네이티브(React Native)' 카테고리의 다른 글
react-native(리액트 네이티브) component - CheckBox (0) | 2019.01.06 |
---|---|
react-native(리액트 네이티브) component - Button (0) | 2019.01.06 |
react-native(리액트 네이티브) props 정의 및 전달 (0) | 2018.10.29 |
react-native 프로젝트 폴더명 변경 관련 에러 (0) | 2018.10.12 |
react-native 크롬 브라우져 디버깅 에러 발생시 (0) | 2018.10.12 |