강의

멘토링

커뮤니티

Cộng đồng Hỏi & Đáp của Inflearn

Hình ảnh hồ sơ của deveq
deveq

câu hỏi đã được viết

Thực tế phát triển ứng dụng React Native cho iOS/Android - Cơ bản

Image

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

Viết

·

1.5K

0

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

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

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

es6react-nativereact

Câu trả lời 3

3

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

Wintho님의 프로필 이미지
Wintho
Người chia sẻ kiến thức

장진영,

안녕하세요. 지식공유자 Wintho입니다.

 

혹시 사용하고 계시는 iOS 버전이 어떻게 되시는지요?

찾아보니 13.5 14.0에서 image가 안 뜬다는 issue 보고가 있네요..

https://github.com/facebook/react-native/issues/29279

https://github.com/facebook/react-native/issues/29215

 

감사합니다.

0

deveq님의 프로필 이미지
deveq
Người đặt câu hỏi

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

Hình ảnh hồ sơ của deveq
deveq

câu hỏi đã được viết

Đặt câu hỏi