小编Oly*_*Oly的帖子

React Native ios应用程序中的"libBacktraceRecording.dylib"内存泄漏

当我尝试运行一个基本的反应本机应用程序时,我看到了libBacktraceRecording.dylib544 KB 的大量内存请求.与其他应用程序相同的事情.

在此输入图像描述

你能帮帮我吗?

谢谢!

memory-leaks ios react-native

6
推荐指数
1
解决办法
1412
查看次数

React Native自动高度WebView在android上不起作用

我正在实现一个动态高度的WebView.我发现这个解决方案就像iOS上的魅力一样,并且不适用于android.该解决方案使用WV中的JS将标题设置为内容高度的值.这是代码:

...
this.state = {webViewHeight: 0};
...
<WebView
    source={{html: this.wrapWevViewHtml(this.state.content)}}
    style={{width: Dimensions.get('window').width - 20, height: this.state.webViewHeight}}
    scrollEnabled={false}
    javaScriptEnabled={true}
    injectedJavaScript="window.location.hash = 1;document.title = document.height;"
    onNavigationStateChange={this.onWebViewNavigationStateChange.bind(this)}
/>
...
onWebViewNavigationStateChange(navState) {
    // navState.title == height on iOS and html content on android
    if (navState.title) {
        this.setState({
            webViewHeight: Number(navState.title)
        });
    }
}
...
Run Code Online (Sandbox Code Playgroud)

但在android上,内部标题的值onWebViewNavigationStateChange等于页面内容.

我究竟做错了什么?

webview android-webview react-native

3
推荐指数
1
解决办法
4345
查看次数