0
内容确实在模拟器内部显示出来,并且用真实设备进行调试,但在用真实设备测试时没有显示任何东西(使用发布的.apk)。它只是显示白色的空白容器。或者我错过了什么?Webview没有显示任何内容(html)反应本机
<WebView
ref={(wView) => {this.wView = wView}}
javaScriptEnabled={true}
// onBridgeMessage={this.onBridgeMessage}
onMessage={this.onMessage}
injectedJavaScript="window.postMessage = String(Object.hasOwnProperty).replace('hasOwnProperty', 'postMessage');"
automaticallyAdjustContentInsets={false}
domStorageEnabled={true}
startInLoadingState={true}
source={mainHtml} <-- load with, var mainHtml = require('./MainHtml.html');
style={{width: 320,height:100,flex: 1}}/>
环境
反应天然-CLI:2.0.1
反应天然:0.43.4
反应:16.0.0-α .6
Device(AS美国Zenfone)
Android版本6.0.1
那么,是否意味着它从项目文件夹的根目录开始? –
谢谢,现在正在工作..我做的是,在android \ app \ src \ main \ assets创建资产文件夹,并将所有HTML文件放在那里,然后用'source = {{uri:' file:/// android_asset/ .html'}} –