Advertisement
joygabriel21

Flex dan Flex Direction

Jan 22nd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import React from "react";
  2. import { StyleSheet, View } from "react-native";
  3.  
  4. export default class Layout extends React.Component {
  5. render() {
  6. return (
  7. <View style={styles.container}>
  8. <View style={[styles.box, styles.box1]}/>
  9. <View style={[styles.box, styles.box2]}/>
  10. <View style={[styles.box, styles.box3]}/>
  11. </View>
  12. );
  13. }
  14. }
  15.  
  16. const styles = StyleSheet.create({
  17. container: {
  18. flex: 1,
  19. flexDirection: "column"
  20. },
  21. box: {
  22. flex: 1
  23. },
  24. box1: {
  25. backgroundColor: '#2196F3'
  26. },
  27. box2: {
  28. backgroundColor: '#8BC34A'
  29. },
  30. box3: {
  31. backgroundColor: '#e3aa1a'
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement