프로젝트/할일목록 앱 (RN)
-
2. 홈화면 구현하기 - 할일목록 보여주기프로젝트/할일목록 앱 (RN) 2023. 8. 20. 17:37
* 오늘 날짜 보여주기 import React from 'react' import { View, Text, StyleSheet } from 'react-native' function DateHeader({ date }){ const year = date.getFullYear() const month = date.getMonth() + 1 const day = date.getDate() return ( {`${year}년 ${month}월 ${day}일`} ) } const styles = StyleSheet.create({ container: { padding: 10, backgroundColor: '#a8c8ffff' }, dateText: { fontSize: 30, color: 'white' } }..
-
1. 리액트 네비게이션으로 탭메뉴 만들기프로젝트/할일목록 앱 (RN) 2023. 8. 20. 15:20
* 네비게이션 뼈대코드 작성하기 npm install @react-navigation/native 리액트에서 탭메뉴를 만들기 위하여 해당 라이브러리를 설치한다. npm install react-native-screens react-native-safe-area-context 리액트 네비게이션 라이브러리는 다른 라이브러리를 이용하여 개발되었기 때문에 관련된 라이브러리들도 설치해줘야 한다. 이를 의존성 라이브러리라고 한다. npm install @react-navigation/native-stack 리액트 네이티브의 스택 내비게이터는 새로운 화면으로 이동하면 스택처럼 위에 쌓고 (push), 다시 이전 화면으로 돌아가면 스택에서 최상단에 있는 화면을 제거하여 (pop) 화면을 이동시킨다. import { S..