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

前端 未结 5 2212
终归单人心
终归单人心 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-19 23:58

    try with this code hop this work for u.

    webview.setInitialScale(getScale()); 
    
    
    
    private int getScale(){
                Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); 
                int width = display.getWidth(); 
                Double val = new Double(width)/new Double(200);
                Log.e("hh", "** "+val);
                val = val * 100d;
                Log.e("hh", "** "+val);
                return val.intValue();
            }
    

提交回复
热议问题