Advertisement
Guest User

Align Items

a guest
Jan 22nd, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. import React from "react";
  2. import { StyleSheet, View } from "react-native";
  3. export default class Layout extends React.Component {
  4. render() {
  5. return (
  6. <View style={styles.wrapper}>
  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. <View style={styles.container2}>
  13. <View style={[styles.box, styles.box1]} />
  14. <View style={[styles.box, styles.box2]} />
  15. <View style={[styles.box, styles.box3]} />
  16. </View>
  17. </View>
  18. );
  19. }
  20. }
  21.  
  22. const styles = StyleSheet.create({
  23. wrapper: {
  24. flex: 1
  25. },
  26. container: {
  27. flex: 0.5,
  28. flexDirection: "row",
  29. justifyContent: "flex-start",
  30. borderBottomWidth: 2,
  31. borderBottomColor: "#000"
  32. },
  33. container2: {
  34. flex: 0.5,
  35. flexDirection: "row",
  36. alignItems: 'flex-start'
  37. },
  38. box: {
  39. height: 100,
  40. width: 100
  41. },
  42. box1: {
  43. backgroundColor: "#2196F3"
  44. },
  45. box2: {
  46. backgroundColor: "#8BC34A"
  47. },
  48. box3: {
  49. backgroundColor: "#e3aa1a"
  50. }
  51. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement