App07Flex.js 491 B

1234567891011121314151617
  1. import React from 'react';
  2. import { View } from 'react-native';
  3. class FlexDimensionsBasics extends React.Component {
  4. render() {
  5. return (
  6. // Try with height: 300 instead of flex: 1
  7. <View style={{ flex: 1 }}>
  8. <View style={{ flex: 1, backgroundColor: 'powderblue' }} />
  9. <View style={{ flex: 2, backgroundColor: 'skyblue' }} />
  10. <View style={{ flex: 3, backgroundColor: 'steelblue' }} />
  11. </View>
  12. );
  13. }
  14. }
  15. export default FlexDimensionsBasics;