美文网首页
react-native Unrecognized font f

react-native Unrecognized font f

作者: sjaljlajslkf | 来源:发表于2018-03-22 14:41 被阅读302次

    ICONS是可以直接使用图片名, 就能加载图片的三方,使用很方便, 你不需要在工程文件夹里塞各种图片, 节省很多空间,下面就来看看怎么使用吧!

    1. 首先打开terminal进入到我们的工程文件夹下, (不会创建工程的请参考:http://blog.csdn.net/margaret_mo/article/details/51304062)

    输入: npm install react-native-vector-icons --save (回车)

    输入: npm install rnpm -g

    输入: rnpm link (回车)

    2. 在Finder中用Xcode打开工程: .../Demo/ios/Demo.xcodeproj

    (1).右键工程文件Add Files to "(你工程名)"

    (2).选择node_modules/react-native-vector-icons/Fonts文件

    (3).点击"完成".

    image image

    3. 在xcode的Info.plist文件中,加入: Fonts provided by application数组,并加入以下9项:

    image

    到此环境就算设置好了, 接下来就是使用ICONS了.

    用source code打开info.plist文件


    image.png

    将以下代码拷贝进去:

    <key>UIAppFonts</key>
      <array>
        <string>Entypo.ttf</string>
        <string>EvilIcons.ttf</string>
        <string>FontAwesome.ttf</string>
        <string>Foundation.ttf</string>
        <string>Ionicons.ttf</string>
        <string>MaterialIcons.ttf</string>
        <string>Octicons.ttf</string>
        <string>SimpleLineIcons.ttf</string>
        <string>Zocial.ttf</string>
        <string>MaterialCommunityIcons.ttf</string>
      </array>
    

    免去了一项一项的添加。

    文章来源:http://www.cnblogs.com/moxiaoyan33/p/5482024.html

    相关文章

      网友评论

          本文标题:react-native Unrecognized font f

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