<WebView
source={{url: 'https://www.google.com'}}
style={{
height: webviewHeight
}}
injectedJavaScript={'window.location.hash = 1;
var calculator = document.createElement("div");
calculator.id = "height-calculator";
while (document.body.firstChild) {
calculator.appendChild(document.body.firstChild);
}
document.body.appendChild(calculator);
document.title = calculator.clientHeight;'}
javaScriptEnabled ={true}
scrollEnabled={false}
onNavigationStateChange={(navStates) => {
if (navStates.title && !isNaN(navStates.title)) {
const htmlHeight = Number(navStates.title) //convert to number
setWebViewHeight(htmlHeight);
}
}}
/>
Comments
Post a Comment