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 {
View,
WebView
WebView,
Platform
} = require('react-native');
var Canvas = createReactClass({
@ -23,7 +24,7 @@ var Canvas = createReactClass({
<View style={this.props.style}>
<WebView
automaticallyAdjustContentInsets={false}
scalesPageToFit={false}
scalesPageToFit={Platform.OS === 'android'}
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>"}}
opaque={false}