코드미뇽
미뇽의 잡다 코딩 공부
코드미뇽
전체 방문자
오늘
어제
  • 분류 전체보기
    • 스파르타코딩클럽
    • React-Native
    • 개발일기
    • 사회

블로그 메뉴

  • 홈
  • 태그
  • 방명록

공지사항

인기 글

태그

  • 스파르타코딩클럽
  • 나만의꿀팁
  • 스파르톤
  • 공스타그램
  • #스파르타코딩클럽 #스파르톤 #힙한취미 #코딩
  • 스파르타코딩

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
코드미뇽

미뇽의 잡다 코딩 공부

[리액트]flexDirection ,   justifyContent
React-Native

[리액트]flexDirection , justifyContent

2021. 7. 11. 01:14
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <View style={styles.containerOne}>

      </View>
      <View style={styles.containerTwo}>
        <View style={styles.innerOne}>

        </View>
        <View style={styles.innerTwo}>

        </View>

      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex:1
  },
  containerOne: {
    flex:1,
    backgroundColor:"red"
  },
  containerTwo:{
    flex:2,
    flexDirection:"row",
    backgroundColor:"yellow"
  },
  innerOne: {
    flex:1,
    backgroundColor:"blue"
  },
  innerTwo: {
    flex:4,
    backgroundColor:"orange"
  }
});

row -> 세로

column  -> 가로 (디폴트값) 지우면 그냥 가로

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    <View style={styles.container}>
      <View style={styles.containerOne}>

      </View>
      <View style={styles.containerTwo}>
        <View style={styles.innerOne}>
         
        </View>
        <View style={styles.innerTwo}>
          <Text>!!컨텐츠!!</Text>
        </View>

      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex:1
  },
  containerOne: {
    flex:1,
    backgroundColor:"red"
  },
  containerTwo:{
    flex:2,
    flexDirection:"row",
    backgroundColor:"yellow"
  },
  innerOne: {
    flex:1,
    backgroundColor:"blue"
  },
  innerTwo: {
    flex:4,
    justifyContent:"flex-start",
    backgroundColor:"orange"
  }
});

  justifyContent:"flex-start", 

 justifyContent:"flex-start-start"  justifyContent:"flex-start-end

end는 우측에 붙이기 start는 좌측에 붙이기, 

 

'React-Native' 카테고리의 다른 글

[나만의꿀팁제작]그 후 24시간 후에 문제해결.  (0) 2021.07.12
[리액트]함수의 골격  (0) 2021.07.11
[리액트] flex  (0) 2021.07.11
[리액트]이미지 꽉 채우기 cover  (0) 2021.07.11
[리액트]이미지이용하여 반복채우기 [리액트네이티브]  (0) 2021.07.11
    'React-Native' 카테고리의 다른 글
    • [나만의꿀팁제작]그 후 24시간 후에 문제해결.
    • [리액트]함수의 골격
    • [리액트] flex
    • [리액트]이미지 꽉 채우기 cover
    코드미뇽
    코드미뇽

    티스토리툴바