• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

ios에서 이미지가 안뜨네요..

20.12.20 19:18 작성 조회수 930

0

안드로이드에서는 정상적으로 이미지가 로딩이 되는데

ios에서 실행 시 이미지가 보이지 않네요 ㅠㅠ

일시적인 오류로 안됬던것일수도 있다 생각들어 다음강의로 넘어가던 중  Header Bar에 이미지를 넣는 부분에서도 ios에서는 안뜨구요.. 

답변 3

·

답변을 작성해보세요.

3

dev538님의 프로필

dev538

2021.01.10

image 가 안뜨는 버그 수정 방법 공유합니다.

1.- run "npm i -g patch-package"
2.- Make a new folder called patches
3.- Make a new file called react-native+0.63.0.patch inside that folder
4.- Add the source code above.
5.- run "patch-package" on the root of the project

------------------------------

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink
 
 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

 

1

장진영,<o:p></o:p>

안녕하세요. 지식공유자 Wintho입니다.<o:p></o:p>

<o:p> </o:p>

혹시 사용하고 계시는 iOS 버전이 어떻게 되시는지요?<o:p></o:p>

찾아보니 13.5 14.0에서 image가 안 뜬다는 issue 보고가 있네요..<o:p></o:p>

https://github.com/facebook/react-native/issues/29279<o:p></o:p>

https://github.com/facebook/react-native/issues/29215<o:p></o:p>

<o:p> </o:p>

감사합니다.<o:p></o:p>

0

장진영님의 프로필

장진영

질문자

2020.12.21

감사합니다 ㅠㅠ 링크에 나와있는 내용대로 하니까 이미지가 정상적으로 나오네요 ㅠㅠㅠ