Illie
RN. android에서 글씨가 가려진다... 본문
개요
모든 게 처음인 김신입,
react native로 어플을 만드는 프로젝트를 맡았다
첫 프로젝트라 심혈을 기울였지만
아차, 깜빡하고 ios에서만 켜보고 android에서는 켜보지 못했다
서둘러 에뮬레이터를 돌려 앱을 켜보는데...
어느 순간부터인지, content가 헤더 뒤에 있기 시작했다
다시 빌드를 하면 또 괜찮은데,,, 또 어느 순간부터 헤더 때문에 내용이 잘린다
세상이 무너진다... 잘리는 건 아닌지 생각이 들어 앞이 아득해진다...
(썸네일이 잘 뽑혀서 신이 나 과몰입 중)
본문
찾아보니 버전이 업데이트되면서 생긴 일종의 버그다
언젠가 없어지겠지 생각을 했지만,,,
아직 없어지지 않고 있다
방법 1. 다운그레이드 하기 (@react-navigation/native-stack )
방법 2. useHeaderHeight()를 활용하여 헤더 크기만큼 패딩주기
방법 3. enableLayoutAnimations를 true or false를 주기 (상황에 따라 다른가 보다)
방법 1 사용 -> 다른 무언가와 맞물려 또 다른 에러가 발생해서 패스
방법 2 사용 -> 번거롭지만, 방법 2를 사용
방법 3 -> 맞물려서 모든 걸 바꾸다가 아주 꼬여버릴 지도 모른다는 생각해 시도하지 않았다 (animation으로 효과를 이미 주고 있었음)
참고)
https://github.com/react-navigation/react-navigation/issues/10531
[Android] content goes behind header in @react-navigation/native-stack · Issue #10531 · react-navigation/react-navigation
Current behavior on android content appears behind header import React from 'react'; import {View, Text} from 'react-native'; export const Content: React.FC = () => { return ( &l...
github.com
https://github.com/software-mansion/react-native-reanimated/issues/2906
React Navigation (Native-stack) header hide screen after reanimated layout animation run [only in Android] · Issue #2906 · sof
Description After reanimated layout animation runs, react-navigation (native-stack) header hide screen. I'm not sure it is because of react-navigation or reanimated issue, but the app still wor...
github.com
'REACT || REACT NATIVE' 카테고리의 다른 글
[RN] 웹뷰를 여러 개 띄었을 때 강제종료되는 버그 (0) | 2023.04.02 |
---|---|
[REACT NATIVE] 함수형 컴포넌트에서 this를 사용하라는 예시를 줄 때 (0) | 2023.03.25 |
RN. 키보드에서 enter을 눌렀을 때, onPress 함수 호출 (0) | 2022.08.28 |
React Native. Props로 컴포넌트 스타일을 커스터마이징하기 (0) | 2022.08.07 |
styled-componont에서 props 사용하기 (0) | 2022.08.06 |