ActivityIndicator
로딩바를 표시하는 컴포넌트이다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import React, {Component} from 'react'; import {StyleSheet, View, ActivityIndicator} from 'react-native'; export default class App extends Component { render() { return ( <View style={[styles.container, styles.horizontal]}> <ActivityIndicator animating="true" size="large" color="#0000ff" /> <ActivityIndicator size="small" color="#00ff00" /> <ActivityIndicator size="large" color="#0000ff" /> <ActivityIndicator size="small" color="#00ff00" /> </View> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center' }, horizontal: { flexDirection: 'row', justifyContent: 'space-around', padding: 10 } }) | cs |
[App.js]
주요속성는 다음과 같다.
animating : ActivityIndicator 표시할지 말지 여부를 나타낸다. (기본값 true)
color : spinner에 전경색을 표시한다. (기본값 회색)
size : ActivityIndicator에 크기를 지정한다. 숫자값을 지원하는건 Android에서만 가능
원문 : https://facebook.github.io/react-native/docs/activityindicator
'React & React Native ' 카테고리의 다른 글
리액트네이티브 Image Component not loading http, React Native Http 허용 , http 요청시 이미지 로딩 안됨 (0) | 2019.01.01 |
---|---|
React Native VSCODE 단축키 (자주 사용하는) (0) | 2018.12.31 |
2018년에 당신이 알아야할 리액트 네이티브 컴포넌트 라이브러리 11가지 (0) | 2018.12.29 |
리액트네이티브 리스트 React Native FlatList Component - #1 (0) | 2018.12.29 |
리액트네이티브 UI Tool, NativeBase (0) | 2018.12.28 |