SHARE
TWEET

Flex dan Flex Direction

joygabriel21 Jan 22nd, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top