安装react-native-custom-segmented控件,react-native项目需要安装ios框架

Installing react-native-custom-segmented control, need to install ios framework to react-native project

我正在尝试将此安装:https://github.com/wix/react-native-custom-segmented-control 到我的 react-native 项目中。

在安装说明中,它说将 .xcodeproj 文件移动到我的项目文件夹。我将它拖到项目的根文件夹中(尽管我不确定这样做是否正确)。

然后说明说要将 libCustomSegmentedControl.a 文件添加到我的目标库中。

该项目是使用 expo 初始化的,我认为它没有 xcode 目标项目?我对如何继续安装它感到困惑。在 react-native 应用程序中是否有一个秘密位置可以找到 xcode 项目?

我是 ios 的初学者,非常感谢任何帮助!

如果您使用 expo 创建了项目,那么您需要先将其弹出,然后才能安装 expo 不支持的任何模块。

您可以在此 link 找到更多信息。 https://docs.expo.io/versions/latest/expokit/eject

Expo 在代码库中实际上没有 Xcode 或 Android 项目,因此您不能将 react-native-custom-segmented-control 添加到 expo 项目中。

这个 post 很好地分解了使用 expo 或 react-native init

创建 react-native 项目之间的区别