React Native APP進(jìn)行打包之后,Echarts圖標(biāo)不顯示問題解決方案:
1.1復(fù)制tpl.html文件
復(fù)制文件tpl.html(路徑: node_modules\native-echarts\src\components\Echarts)
至android\app\src\main\assets目錄下
1.2編輯index.js文件
路徑:node_modules\native-echarts\src\components\Echarts
將
source={require('./tpl.html')}
修改為
source={Platform.OS==='ios' ? require('./tpl.html'):{uri:'file:///android_asset/tpl.html'}}
同時,
修改
import { WebView, View, StyleSheet } from 'react-native';
為
import { WebView, View, StyleSheet, Platform } from 'react-native';
React Native Echarts放大縮小問題解決方案:
修改index.js文件中
scalesPageToFit={false}
為
scalesPageToFit={Platform.OS === 'android' ? true : false}