Dynamic webview height


#1

Hi,

I have problem with creating article detail page in my app.

I don’t know if is possible get WebView without scrollbars which height will be same as height of web content?

I have sample here but UX is really bad and I can’t find solution a lot of days. https://play.nativescript.org/?template=play-ng&id=DXJkOJ&v=10

Any suggestions please?


#2

@b4rtt Here you go

I just copied html content from nativescript blog to this static page here, then injected the code below after html body. So when site is loaded, I will get the height of the site in it’s URL hash.

<script>
    var body = document.body,
        html = document.documentElement;

    var height = Math.max(body.scrollHeight, body.offsetHeight,
        html.clientHeight, html.scrollHeight, html.offsetHeight);
    document.location.href += "#" + height;
</script>