fix: set scalesPageToFit to true for android to disable scroll

This commit is contained in:
Sen Wang 2017-08-14 12:18:47 +08:00
parent 99a6f8d274
commit beae9580e1

View File

@ -6,7 +6,8 @@ var createReactClass = require('create-react-class');
var { var {
View, View,
WebView WebView,
Platform
} = require('react-native'); } = require('react-native');
var Canvas = createReactClass({ var Canvas = createReactClass({
@ -23,7 +24,7 @@ var Canvas = createReactClass({
<View style={this.props.style}> <View style={this.props.style}>
<WebView <WebView
automaticallyAdjustContentInsets={false} automaticallyAdjustContentInsets={false}
scalesPageToFit={false} scalesPageToFit={Platform.OS === 'android'}
contentInset={{top: 0, right: 0, bottom: 0, left: 0}} contentInset={{top: 0, right: 0, bottom: 0, left: 0}}
source={{html: "<style>*{margin:0;padding:0;}canvas{transform:translateZ(0);}</style><canvas></canvas><script>var canvas = document.querySelector('canvas');(" + renderString + ").call(" + contextString + ", canvas);</script>"}} source={{html: "<style>*{margin:0;padding:0;}canvas{transform:translateZ(0);}</style><canvas></canvas><script>var canvas = document.querySelector('canvas');(" + renderString + ").call(" + contextString + ", canvas);</script>"}}
opaque={false} opaque={false}