Merge pull request #85 from wxsms/fix-android
Fix echarts displayed incorrect width in Android
This commit is contained in:
commit
656a2d3838
|
|
@ -1,5 +1,5 @@
|
|||
import React, { Component } from 'react';
|
||||
import { WebView, View, StyleSheet } from 'react-native';
|
||||
import { WebView, View, StyleSheet, Platform } from 'react-native';
|
||||
import renderChart from './renderChart';
|
||||
import echarts from './echarts.min';
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export default class App extends Component {
|
|||
height: this.props.height || 400,
|
||||
backgroundColor: this.props.backgroundColor || 'transparent'
|
||||
}}
|
||||
scalesPageToFit={false}
|
||||
scalesPageToFit={Platform.OS !== 'ios'}
|
||||
source={require('./tpl.html')}
|
||||
onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
|
||||
<title>echarts</title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<style type="text/css">
|
||||
html,body {
|
||||
height: 100%;
|
||||
|
|
|
|||
Loading…
Reference in New Issue