App08FlexLayout.js 788 B

123456789101112131415161718192021222324
  1. import React from 'react';
  2. import { View } from 'react-native';
  3. class FlexDirectionBasics extends React.Component {
  4. render() {
  5. return (
  6. // Try with height: 300 instead of flex: 1
  7. <View style={{
  8. flex: 1,
  9. // row or column
  10. flexDirection: 'column',
  11. // flex-start, center, flex-end, space-around, space-between
  12. // space-evenly is also described, but throws invalid value error.
  13. justifyContent: 'space-around',
  14. }}>
  15. <View style={{ height: 50, width: 50, backgroundColor: 'powderblue' }} />
  16. <View style={{ height: 50, width: 50, backgroundColor: 'skyblue' }} />
  17. <View style={{ height: 50, width: 50, backgroundColor: 'steelblue' }} />
  18. </View>
  19. );
  20. }
  21. }
  22. export default FlexDirectionBasics;