Browse Source

0.1.1 ActivityIndicator.

Frederic G. MARAND 7 năm trước cách đây
mục cha
commit
967b940654
2 tập tin đã thay đổi với 37 bổ sung1 xóa
  1. 1 1
      App.js
  2. 36 0
      components/ActivityIndicator.js

+ 1 - 1
App.js

@@ -1,6 +1,6 @@
 // import { AppRegistry } from 'react-native';
 
-import App from './basics/App12ScrollView';
+import App from './components/ActivityIndicator';
 
 export default App;
 

+ 36 - 0
components/ActivityIndicator.js

@@ -0,0 +1,36 @@
+import React from 'react';
+import {
+  ActivityIndicator,
+  StyleSheet,
+  View,
+} from 'react-native';
+
+const styles = StyleSheet.create({
+  container: {
+    flex: 1,
+    justifyContent: 'center',
+  },
+  horizontal: {
+    flexDirection: 'row',
+    justifyContent: 'space-around',
+    padding: 10,
+  },
+});
+
+class App extends React.Component {
+  render() {
+    return (
+      // - size as a number is only valid on Android (actually crashes, though)
+      // - color defaults to 'gray', supports #xxxx, rgb(), rgba(), hsl(), hsla()
+      // - hidesWhenStopped only works on iOS.
+      <View style={[styles.container, styles.horizontal]}>
+        <ActivityIndicator size="large" color="#0000ff" />
+        <ActivityIndicator size="small" color="#00ff00" hidesWhenStopped={false} animating={false} />
+        <ActivityIndicator size="small" color="red" />
+        <ActivityIndicator size="large" color="#0002" />
+      </View>
+    );
+  }
+}
+
+export default App;