美文网首页
引用react-native-vector-icons提示ttf

引用react-native-vector-icons提示ttf

作者: Bana | 来源:发表于2020-08-04 16:15 被阅读0次

复制下面的内容到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

image

然后Xcode运行项目

作者:浮生似梦_RG
链接:https://www.jianshu.com/p/054773f0fa44
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关文章

网友评论

      本文标题:引用react-native-vector-icons提示ttf

      本文链接:https://www.haomeiwen.com/subject/ovuwrktx.html