我已經習慣react-native-vector-icons@^9.2.0在我們的應用程式中使用矢量圖示。
節點版本:
v16.16.0; npm 版本:8.11.0; 反應本機版本:0.69.0; 吊艙版本:1.11.3
這是我遵循的程序,
首先,我已經安裝react-native-vector-icons,然后從node_modules/react-native-vector-icons復制字體檔案夾,然后將其粘貼到通過 Xcode 打開的projectName.xcworkspace中,然后手動添加字體名稱,這是.ttf擴展名的型別。然后使用命令安裝 pod。添加后自動添加的字體如下所示,pod installinfo.plist
<key>UIAppFonts</key>
<array>
<string>Zocial.ttf</string>
<string>SimpleLineIcons.ttf</string>
<string>Octicons.ttf</string>
<string>MaterialIcons.ttf</string>
<string>MaterialCommunityIcons.ttf</string>
<string>Ionicons.ttf</string>
<string>Foundation.ttf</string>
<string>Fontisto.ttf</string>
<string>FontAwesome5_Solid.ttf</string>
<string>FontAwesome5_Regular.ttf</string>
<string>FontAwesome5_Brands.ttf</string>
<string>FontAwesome.ttf</string>
<string>Feather.ttf</string>
<string>EvilIcons.ttf</string>
<string>AntDesign.ttf</string>
<string>Entypo.ttf</string>
</array>
然后我運行專案,但出現附件中給出的錯誤,請檢查并幫助有知識的我。

uj5u.com熱心網友回復:
嘗試將其添加到您的 assets/ 檔案夾,并在專案的根目錄中創建此檔案:
react-native.config.js
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./path/to/assets/'],
};
參考:https ://mehrankhandev.medium.com/ultimate-guide-to-use-custom-fonts-in-react-native-77fcdf859cf4
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/505618.html
標籤:javascript IOS 反应式 反应本机矢量图标
上一篇:javascript創建新陣列
