Browse Source

0.0.8 Flex axis.

Frederic G. MARAND 6 years ago
parent
commit
9f8c73c493
2 changed files with 18 additions and 1 deletions
  1. 1 1
      App.js
  2. 17 0
      App08FlexLayout.js

+ 1 - 1
App.js

@@ -1,6 +1,6 @@
 // import { AppRegistry } from 'react-native';
 
-import App from './App07Flex';
+import App from './App08FlexLayout';
 
 export default App;
 

+ 17 - 0
App08FlexLayout.js

@@ -0,0 +1,17 @@
+import React from 'react';
+import { View } from 'react-native';
+
+class FlexDirectionBasics extends React.Component {
+  render() {
+    return (
+      // Try with height: 300 instead of flex: 1
+      <View style={{ flex: 1, flexDirection: 'column' }}>
+        <View style={{ height: 50, width: 50, backgroundColor: 'powderblue' }} />
+        <View style={{ height: 50, width: 50, backgroundColor: 'skyblue' }} />
+        <View style={{ height: 50, width: 50, backgroundColor: 'steelblue' }} />
+      </View>
+    );
+  }
+}
+
+export default FlexDirectionBasics;