gpt4 book ai didi

ios - React-native iOS 不显示图像(pod 问题)

转载 作者:行者123 更新时间:2023-12-03 11:15:49 26 4
gpt4 key购买 nike

我在我的 react-native 应用程序中安装了一个包(具体来说它是 react-navigation 中的 createMaterialTopTabNavigator),但是安装成功后,发生了崩溃(错误:@react-navigation/material-top-tabs/src/index.tsx :意外 token (16:12)),我试图修复它,所以我修复了它,但后来 iOS 上的图像停止工作。
在安装该软件包之前,我的 Image 组件在两个平台(iOS 和 Android)上都能完美运行。
我想这与在 XCode 中处理图像的包/ pods 有关,但我尝试了一些东西但没有奏效(我不是 XCode 专家)。
在 Android 上,它们运行良好。
我为解决问题所做的但没有奏效:
- 将我的 react-native 版本从“0.61.5”升级到“0.62”
- 删除 pod,清理项目并使用“pod install”重新安装 pod
-试过this answer但我想这不完全是我的问题。
你知道我还能做什么吗?我的想法不多了,我在互联网上找不到太多关于这个话题的信息。
谢谢!
更新
Image 组件使它的动画就像加载了图像一样,它只是不显示它。所以我确定这与 iOS 项目有关,也因为在 android 中运行良好。

最佳答案

如果您没有运行最新的 react-native 版本或不打算升级到最新版本的 react-native,则在 Xcode12 构建和修复中会看到图像问题,然后转到

node_modules > react-native > Libraries > Images > RCTUIImageViewAnimated.msearch for if (_currentFrame)


将以下 else block 添加到 if block 中,如下所示
 if (_currentFrame) {
layer.contentsScale = self.animatedImageScale;
layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
[super displayLayer:layer];
}
引用 : https://github.com/facebook/react-native/issues/29279#issuecomment-658244428

关于ios - React-native iOS 不显示图像(pod 问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63949851/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com