React Native

    [React Native] Percentage width in Flatlist Item

    FlatList 내에서 Item의 width를 Percentage로 정하기 FlatList 내의 item Style을 정해줄 때, width: '90%' 이런식으로는 적용되지 않는다. 아래와 같이, Screen의 Dimension을 구하여 * percent로 해주면 잘 적용된다! import { Dimensions } from "react-native" const ITEM_BOX: ViewStyle = { width: Dimensions.get('screen').width * 0.90, ... 중략 ... }

    [React Native] CSS 속성 정리 - 배치, 정렬

    flexDirection column 해당 옵션이 설정된 자식뷰들을 세로로 배치 (default) row 해당 옵션이 설정된 자식뷰들을 가로로 배치 alignItems flexDirection이 column인지 row인지에 따라 가로 세로 기준이 바뀐다. flexDirection을 기준으로 수직한 형태로 정렬한다. 예를 들어, flexDirection: column 이라면, 가로로 나열하는 것이니 alignItems는 세로로 정렬하는 옵션이 된다. flex-start 가로 정렬 기준, 좌측(시작점) center 가로 정렬 기준 가운데 flex-end 가로 정렬 기준 우측 stretch flex-start 지점부터 flex-end 지점까지 늘림, 단, 이 때 정렬 방향 기준의 값을 정해두지 않아야 적용된다..