Created
March 30, 2016 13:18
-
-
Save herbertdai/7bf8fd8a6194037089d2d20b4fde8c0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const script = `<script>window.location.hash = 1;document.title = document.getElementsByTagName('html')[0].scrollHeight;</script>`; | |
onNavigationStateChange(navState) { | |
Util.log("webView Height:", navState.title); | |
this.setState({ | |
height: navState.title | |
}); | |
} | |
renderMobileBody(){ | |
return( | |
<WebView | |
automaticallyAdjustContentInsets={false} | |
style={[styles.webView, {height: Number(this.state.height)}]} | |
source={{html: this.htmls + script}} | |
onNavigationStateChange={this.onNavigationStateChange.bind(this)} | |
javaScriptEnabled={true} | |
domStorageEnabled={true} | |
scalesPageToFit={true} | |
decelerationRate="normal" | |
javaScriptEnabledAndroid={true} | |
/> | |
); | |
} |
it's work.
I can take html height.
But how to calculate px height to dp?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
some time it work not exactly