Copy import React, {
Component
} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
export default class layouPractice extends Component {
render() {
return (
<View style={styles.parent}>
<View style={[styles.topBlock, styles.base]}>
<View style={[styles.leftCol, styles.base]}>
<View style={[styles.cellOne, styles.base]}>
<Text>1</Text>
</View>
<View style={[styles.cellTwo, styles.base]}>
<Text>2</Text>
</View>
</View>
<View style={[styles.cellThree, styles.base]}>
<Text>3</Text>
</View>
</View>
<View style={[styles.bottomBlock, styles.base]}>
<View style={[styles.cellFour, styles.base]}>
<Text>4</Text>
</View>
<View style={[styles.cellFive, styles.base]}>
<Text>5</Text>
</View>
<View style={[styles.bottomRight]}>
<View style={[styles.cellSix, styles.base]}>
<Text>6</Text>
</View>
<View style={[styles.cellSeven, styles.base]}>
<Text>7</Text>
</View>
</View>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
parent: {
flex: 1,
flexDirection: 'column',
position: 'absolute',
top: 30,
left: 0,
right: 0,
bottom: 0
},
topBlock: {
flex: 5,
flexDirection: 'row'
},
bottomBlock: {
flex: 2,
flexDirection: 'row'
},
bottomRight: {
flex: 2,
flexDirection: 'column'
},
leftCol: {
flex: 2
},
cellOne: {
flex: 1,
borderBottomWidth: 15
},
cellTwo: {
flex: 3
},
cellThree: {
backgroundColor: '#FF0000',
flex: 5
},
cellFour: {
flex: 3,
backgroundColor: '#0000FF'
},
cellFive: {
flex: 6
},
cellSix: {
flex: 1
},
cellSeven: {
flex: 1
},
base: {
borderColor: '#000000',
borderWidth: 2
}
});
AppRegistry.registerComponent('layouPractice', () => layouPractice);