美文网首页rn
处理React Native中Echarts图表不显示和缩小问题

处理React Native中Echarts图表不显示和缩小问题

作者: 做全栈攻城狮 | 来源:发表于2018-06-15 18:11 被阅读195次

React Native APP进行打包之后,Echarts图标不显示问题解决方案:

1.1复制tpl.html文件

复制文件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}

相关文章

网友评论

    本文标题:处理React Native中Echarts图表不显示和缩小问题

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