커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
flex에 대해 질문
[왕초보] 나만의 수익성 앱, 앱개발 종합반 v3
2주차
북마크
전*환
댓글
6
추천
0
조회수
21
조회수
21
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


flex의 요소 중 flexDirection을 이리저리 만져보던 중, 아래 코드를 작성했더니 컨텐츠 view가 아래로 내려가더랍니다.


컨텐츠의 상위뷰인 이너투의 flexDirection은 row고, alignitems는 flex-end인데, 자식요소인 컨텐츠가 어떻게 아래로 내려간건지 이해가 되질 않습니다.








작성한 코드 및 에러 메세지


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 style={styles.content}></View>
        </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",
// 바로 여기요!! 밑줄!!
    alignItems:"flex-end",
    flexDirection:"row"
  },
  content: {
    width:50,
    height:50,
    backgroundColor:"#000"
  }
});



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴