How to show Certain Part of WebPage inside Webview With Fit Screen to All Devices

前端 未结 5 2182
终归单人心
终归单人心 2021-02-19 23:13

I Want to Show WebPage Inside WebView. Up to this it is fine.

But I have WebPage (As Given Below) and I want Certain Part of it. I mean just Top Left Corner should be vi

5条回答
  •  礼貌的吻别
    2021-02-20 00:01

    WebView x;
    
    x.setInitialScale(1);
    

    This is the furtheset zoom possible. But for some sites it just looks pure UGLY.

    This was the second version I found

    test1.getSettings().setDefaultZoom(ZoomDensity.FAR);
    

    Thats a nice all rounder than seems to just zoom out far enough for a lot but still not what I was looking for.

    And now here is the final solution I have.

    x.getSettings().setLoadWithOverviewMode(true);
    x.getSettings().setUseWideViewPort(true);
    

    Basically what these do is answered in another question like this.

    setLoadWithOverviewMode(true) 
    

    Loads the WebView completely zoomed out

    setUseWideViewPort(true)
    

提交回复
热议问题