ActivityIndicator.js 957 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React from 'react';
  2. import {
  3. ActivityIndicator,
  4. StyleSheet,
  5. View,
  6. } from 'react-native';
  7. const styles = StyleSheet.create({
  8. container: {
  9. flex: 1,
  10. justifyContent: 'center',
  11. },
  12. horizontal: {
  13. flexDirection: 'row',
  14. justifyContent: 'space-around',
  15. padding: 10,
  16. },
  17. });
  18. class App extends React.Component {
  19. render() {
  20. return (
  21. // - size as a number is only valid on Android (actually crashes, though)
  22. // - color defaults to 'gray', supports #xxxx, rgb(), rgba(), hsl(), hsla()
  23. // - hidesWhenStopped only works on iOS.
  24. <View style={[styles.container, styles.horizontal]}>
  25. <ActivityIndicator size="large" color="#0000ff" />
  26. <ActivityIndicator size="small" color="#00ff00" hidesWhenStopped={false} animating={false} />
  27. <ActivityIndicator size="small" color="red" />
  28. <ActivityIndicator size="large" color="#0002" />
  29. </View>
  30. );
  31. }
  32. }
  33. export default App;