【问题标题】:requireNativeComponent: 'RNSVGLinearGradient' was not found in the UIManagerrequireNativeComponent:在 UIManager 中找不到“RNSVGLinearGradient”
【发布时间】:2019-06-24 10:27:24
【问题描述】:

我还安装了带有 svg 的 react-native-chart-kit,但在运行应用程序时出现错误。我有图书馆网站的基本代码

<PieChart
data={data}
width={150}
height={220}
chartConfig={chartConfig}
accessor="population"
backgroundColor="transparent"
paddingLeft="15"
absolute
/>

【问题讨论】:

    标签: react-native


    【解决方案1】:

    我想你需要链接它。运行以下代码,然后构建您的应用程序

    反应原生链接

    【讨论】:

      【解决方案2】:

      这对我有用:

      纱线添加 react-native-svg

      【讨论】:

        【解决方案3】:

        我在 ios 上使用 react-native-chart-kit 的 PieChart 时遇到了完全相同的问题。我通过在安装了 RNSVG (12.3.0) 的 ios 目录中执行“pod install”解决了这个问题。之后一切正常,一旦我通过 Xcode 重新编译了所有内容。

        【讨论】:

          猜你喜欢
          • 2022-10-23
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-08-27
          • 2020-09-02
          • 2021-06-29
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多