2018-06-01 react-native webview
2018-06-01 本文已影响0人
duansiyu
<WebView style={{width: width, height:this.state.height}}
ref="webview"
javaScriptEnabled={true}
domStorageEnabled={true}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
decelerationRate="normal"
source={{html:`${this.state.detail}window.onload=function(){window.location.hash = 1;document.title = document.body.clientHeight;}`}}
scalesPageToFit={false}
onNavigationStateChange={(title)=>{
if(title.title !=undefined) {
this.setState({
height:(parseInt(title.title)+20)
})
}
}}
/>