react-native 5

[React Native] ScrollView과 position: absolute를 같이 쓰고 싶을 때 (flex를 이용하는 방법)

목표 각각의 탭을 클릭했을 때 나오는 content가 scrollview이면서 그 scrollview의 position이 absolute이고, zIndex로 해당 scrollview를 보여주고 숨기고를 구현하고 싶었다. 실패 여느 view를 구현하듯이 scrollview에도 position: 'absolute'를 적용했더니, 끝까지 스크롤되지 않았다. 구글링을 많이 해봤지만 통하지 않았다. 해결법 position: 'relative'. 즉 position은 건들지 않고, flex만 건들면 되는 문제였다. height도 설정해줘야 한다. 그렇지 않으면 완전히 겹쳐지지 않는다. 나같은 경우는 1000으로 설정했지만, 실제로 1000까지 스크롤되지는 않는다. 코드 {/* S1 *} {...content} {/..

[React Native] push notification custom sound 설정하기 / 커스텀 사운드 / 푸시알람

[React Native] push notification custom sound 설정하기 / 커스텀 사운드 / 푸시알람 라이브러리: github.com/zo0r/react-native-push-notification버전: 5.1.01. iOS1) project/ios 폴더에 .caf 파일을 추가한다. (xcode에서 말고 finder에서!)2) xcode에서 다음과 같이 프로젝트 이름에서 우클릭 - Add Files to "project" 클릭 후 ios 폴더에 추가해놓은 파일을 선택한다.3) 코드 작성 import PushNotification, { PushNotificationScheduleObject } from 'react-native-push-notification'; ..

[React Native] AppState / detect foreground, background

0. 소개AppState를 이용하면 앱이 background였다가 foreground 상태로 왔는지, 그 반대인지를 알 수 있다.  1. 문서https://reactnative.dev/docs/appstate.html React Native · A framework for building native apps using ReactA framework for building native apps using Reactreactnative.dev 2. Usage앱이 포그라운드 -> 백그라운드 로 가는 순간appState는 active -> inactive -> background로 바뀐다. 이 과정에서 앱이 백그라운드 상태가 되면 setAppState가 매끄럽게 이어져서 appState는 background여..

[React Native] 갤러리에서 사진 가져오기 (iOS)

react-native: 0.61.5 갤러리에서 사진을 가져오려면 camera 권한이 필요함. 1) PHOTO_LIBRARY 권한 요청 https://coding-dahee.tistory.com/145 [React Native] react-native-permission 사용법https://github.com/react-native-community/react-native-permissions react-native-community/react-native-permissions An unified permissions API for React Native on iOS and Android - react-native-commu..coding-dahee.tistory.com권한 요청 라이브러리 사용은 위 포..

[React Native] NFC 태그 시 앱/어플 실행시키는 방법 (Android 위주)

[Android]방법1. 실행시키길 원하는 앱의 소스코드 만지기결과적으로는 https://github.com/observ3r/nfc-ndef-react-native 에 있는 android 코드를 사용했더니 됐다! (라이브러리 설치 없이)1) android/app/src/main/AndroidManifest.xml 에 다음 권한 추가 2) 같은 파일에 다음 코드 추가...  activity 태그 안에 기존 intent-filter도 있다.intent-filter를 정확하겐 모르지만 앱을 클릭해서 실행 또는 nfc로 태그해서 실행할 수 있음을 의미하는게 저 2개의 intent-filter 같음!  3) android/app/src/main/res/xml/n..

출처: https://mingos-habitat.tistory.com/34 [밍고의서식지:티스토리]