WebView不会在api 29中加载内容,但在api 28中工作

问题描述

我正在尝试在react native中加载本地html。在android中,当已编译的和目标api更改为29时,webview不会显示任何内容,但是当我恢复为28时,它可以正常工作。由于androidx问题,我正在使用React Native核心Webview而不是社区版本。有人遇到这种问题吗?

<WebView
    source={{ html: this.html }}
    startInLoadingState={false}
    useWebKit={true}
    allowUniversalAccessFromFileURLs={true}
    allowFileAccess={true}
    thirdPartyCookiesEnabled={true}
    javaScriptEnabled={true}
    domStorageEnabled={true}
    thirdPartyCookiesEnabled={true}
    scalesPagetoFit={Platform.OS === "ios"}
    onLoad={this._loadEnd.bind(this)}
    onLoadEnd={() => console.warn("loading has ended")}
    onError={() => console.warn("Loading Error")}
    injectedJavaScript="document.forms['depositform'].submit()"
    renderLoading={() => <Loading />}
    onNavigationStateChange={(result) =>
      this._onNavigationStateChange(result)
    }
  />

react-native : 0.59.1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)