复制下面的内容到plist里面: (各个版本的react-native-vector-icons可能ttf文件不一样,需要注意修改)
<key>UIAppFonts</key>
<array>
<string>Fontisto.ttf</string>
<string>Octicons.ttf</string>
<string>Feather.ttf</string>
<string>Entypo.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>AntDesign.ttf</string>
<string>Foundation.ttf</string>
<string>Ionicons.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome.ttf</string>
<string>Zocial.ttf</string>
<string>EvilIcons.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>MaterialIcons.ttf</string>
</array>
运行项目, 可能会报错
error: Multiple commands produce '/Users/dream/LibraryzuiXinAwesomeProject.app/Zocial.ttf':
1) Target 'zuiXinAwesomeProject' (project 'zuiXinAwesomeProject') has copy command from ios/Fonts/Zocial.ttf' to '/zuiXinAwesomeProject.app/Zocial.ttf'
2) That command depends on command in Target 'zuiXinAwesomeProject' (project 'zuiXinAwesomeProject'): script phase “[CP] Copy Pods Resources”
跟Xcode版本有关, Xcode10以后,
不使用New Build System,在File > Project/Workspace Settings中的Share Project/Workspace Settings 里build system 将New Build System(Default)切换成Legacy build system
![](https://img.haomeiwen.com/i9181332/7bac41c5f95f13f5.png)
然后Xcode运行项目
作者:浮生似梦_RG
链接:https://www.jianshu.com/p/054773f0fa44
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
网友评论