Browse Source

0.0.7 Flex dimensions.

Frederic G. MARAND 6 năm trước cách đây
mục cha
commit
0c3d46ffb8
2 tập tin đã thay đổi với 18 bổ sung1 xóa
  1. 1 1
      App.js
  2. 17 0
      App07Flex.js

+ 1 - 1
App.js

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

+ 17 - 0
App07Flex.js

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