【发布时间】:2018-05-19 14:31:47
【问题描述】:
我在 webview 中为我的应用程序渲染了本地 html,它在 iOS 和 Android 上都运行良好。这是一个嵌入了 svg 标签的 html。
但是,一旦我在 Android 上生成了一个 apk 并尝试在我的手机上本地运行,它就无法呈现。
即使在导出 .ipa 文件时也能在 iOS 上正常运行
const VECTOR_BODY_HTML = require('../custom_views/vector-body.html');
...
<WebView
ref={component => this.mWebView = component}
automaticallyAdjustContentInsets = {false}
contentInset={{top:0 , left:0 ,bottom:-20, right:0}}
source = {VECTOR_BODY_HTML}
scalesPageToFit = {false}
onLoad = {() => {
this.updateBodyViewBox(bodyWidth, bodyHeight);
this.initColorMap();
this.populateBodyMap(15)
}
}
onMessage = {(data) => {this.onMessage(data);}}
style = {{height:bodyHeight}}
>
</WebView>
【问题讨论】:
标签: android react-native webview build apk